Pārlūkot izejas kodu

[RN] Secure entry, no automatic correction for room-lock passwords

j8
Lyubo Marinov 8 gadus atpakaļ
vecāks
revīzija
3d32c2de89

+ 1
- 0
react/features/base/dialog/components/Dialog.native.js Parādīt failu

@@ -112,6 +112,7 @@ class Dialog extends AbstractDialog {
112 112
                 placeholder = { t(bodyKey) }
113 113
                 submitButtonTextStyle = { submitButtonTextStyle }
114 114
                 submitText = { t(okTitleKey) }
115
+                textInputProps = { this.props.textInputProps }
115 116
                 title = { titleString || t(titleKey) }
116 117
                 visible = { true } />
117 118
         );

+ 10
- 0
react/features/room-lock/components/PasswordRequiredPrompt.native.js Parādīt failu

@@ -21,6 +21,15 @@ type Props = {
21 21
     dispatch: Dispatch<*>
22 22
 };
23 23
 
24
+/**
25
+ * The style of the {@link TextInput} rendered by
26
+ * {@code PasswordRequiredPrompt}. As it requests the entry of a password, the
27
+ * entry should better be secure.
28
+ */
29
+const _TEXT_INPUT_PROPS = {
30
+    secureTextEntry: true
31
+};
32
+
24 33
 /**
25 34
  * Implements a React {@code Component} which prompts the user when a password
26 35
  * is required to join a conference.
@@ -62,6 +71,7 @@ class PasswordRequiredPrompt extends Component {
62 71
                 bodyKey = 'dialog.passwordLabel'
63 72
                 onCancel = { this._onCancel }
64 73
                 onSubmit = { this._onSubmit }
74
+                textInputProps = { _TEXT_INPUT_PROPS }
65 75
                 titleKey = 'dialog.passwordRequired' />
66 76
         );
67 77
     }

+ 11
- 0
react/features/room-lock/components/RoomLockPrompt.native.js Parādīt failu

@@ -8,6 +8,16 @@ import { Dialog } from '../../base/dialog';
8 8
 
9 9
 import { endRoomLockRequest } from '../actions';
10 10
 
11
+/**
12
+ * The style of the {@link TextInput} rendered by {@code RoomLockPrompt}. As it
13
+ * requests the entry of a password, {@code TextInput} automatically correcting
14
+ * the entry of the password is a pain to deal with as a user.
15
+ */
16
+const _TEXT_INPUT_PROPS = {
17
+    autoCapitalize: 'none',
18
+    autoCorrect: false
19
+};
20
+
11 21
 /**
12 22
  * Implements a React Component which prompts the user for a password to lock  a
13 23
  * conference/room.
@@ -54,6 +64,7 @@ class RoomLockPrompt extends Component {
54 64
                 bodyKey = 'dialog.passwordLabel'
55 65
                 onCancel = { this._onCancel }
56 66
                 onSubmit = { this._onSubmit }
67
+                textInputProps = { _TEXT_INPUT_PROPS }
57 68
                 titleKey = 'toolbar.lock' />
58 69
         );
59 70
     }

Notiek ielāde…
Atcelt
Saglabāt