Skip to content

Commit 7f113f1

Browse files
Merge pull request #200 from OpenDTU-App/48-weird-behavior-with-text-fields
2 parents f9628ed + 7f3e189 commit 7f113f1

8 files changed

+12
-12
lines changed

src/components/modals/ChangeCustomNameModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const ChangeCustomNameModal: FC<ChangeCustomNameModalProps> = props => {
6767
<StyledTextInput
6868
label={t('device.deviceName')}
6969
mode="outlined"
70-
value={customName}
70+
defaultValue={customName}
7171
onChangeText={setCustomName}
7272
style={{ backgroundColor: theme.colors.elevation.level3 }}
7373
/>

src/components/modals/ChangeGraphRefreshIntervalModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const ChangeGraphRefreshIntervalModal: FC<
6565
label={t('settings.milliseconds')}
6666
keyboardType="numeric"
6767
mode="outlined"
68-
value={intervalState?.toString()}
68+
defaultValue={intervalState?.toString()}
6969
onChangeText={handleChange}
7070
style={{ backgroundColor: theme.colors.elevation.level3 }}
7171
right={<StyledTextInput.Affix text="ms" />}

src/components/modals/ChangeOpendtuCredentialsModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ const ChangeOpendtuCredentialsModal: FC<
115115
<StyledTextInput
116116
label={t('setup.username')}
117117
mode="outlined"
118-
value={username}
118+
defaultValue={username}
119119
onChangeText={setUsername}
120120
textContentType="username"
121121
style={{ backgroundColor: theme.colors.elevation.level3 }}
122122
/>
123123
<StyledTextInput
124124
label={t('setup.password')}
125125
mode="outlined"
126-
value={password}
126+
defaultValue={password}
127127
onChangeText={setPassword}
128128
textContentType="password"
129129
style={{ backgroundColor: theme.colors.elevation.level3 }}

src/components/modals/ChangeServerUrlModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ChangeServerUrlModal: FC<ChangeServerUrlModalProps> = props => {
5454
<StyledTextInput
5555
label={t('settings.serverUrl')}
5656
mode="outlined"
57-
value={baseUrl}
57+
defaultValue={baseUrl}
5858
onChangeText={setBaseUrl}
5959
style={{ backgroundColor: theme.colors.elevation.level3 }}
6060
/>

src/components/modals/ChangeTextValueModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const ChangeTextValueModal: FC<ChangeValueModalProps> = ({
138138
</View>
139139
<View style={{ marginTop: 32 }}>
140140
<TextInput
141-
value={value}
141+
defaultValue={value}
142142
onChangeText={value => {
143143
setWasModified(true);
144144
setError(null);

src/components/modals/LimitConfigModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ const LimitConfigModal: FC<LimitConfigModalProps> = ({
226226
label={t('limitStatus.limitValue', {
227227
unit: limitType === 'absolute' ? 'W' : '%',
228228
})}
229-
value={limitValue}
229+
defaultValue={limitValue}
230230
onChangeText={(text: string) => {
231231
setLimitValue(text);
232232
setError(null);

src/components/modals/ManageDatabaseModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const ManageDatabaseModal: FC<ManageDatabaseModalProps> = props => {
109109
<StyledTextInput
110110
label={t('database.name')}
111111
mode="outlined"
112-
value={name}
112+
defaultValue={name}
113113
onChangeText={setName}
114114
style={{ backgroundColor: theme.colors.elevation.level3 }}
115115
/>
@@ -118,7 +118,7 @@ const ManageDatabaseModal: FC<ManageDatabaseModalProps> = props => {
118118
<StyledTextInput
119119
label={t('database.baseUrl')}
120120
mode="outlined"
121-
value={baseUrl}
121+
defaultValue={baseUrl}
122122
onChangeText={setBaseUrl}
123123
placeholder={baseUrlPlaceholder}
124124
style={{ backgroundColor: theme.colors.elevation.level3 }}
@@ -128,7 +128,7 @@ const ManageDatabaseModal: FC<ManageDatabaseModalProps> = props => {
128128
<StyledTextInput
129129
label={t('database.username')}
130130
mode="outlined"
131-
value={username}
131+
defaultValue={username}
132132
onChangeText={setUsername}
133133
style={{ backgroundColor: theme.colors.elevation.level3 }}
134134
/>
@@ -137,7 +137,7 @@ const ManageDatabaseModal: FC<ManageDatabaseModalProps> = props => {
137137
<StyledTextInput
138138
label={t('database.password')}
139139
mode="outlined"
140-
value={password}
140+
defaultValue={password}
141141
onChangeText={setPassword}
142142
secureTextEntry
143143
style={{ backgroundColor: theme.colors.elevation.level3 }}

src/components/modals/TimeRangeLastNSecondsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const TimeRangeLastNSecondsModal: FC<TimeRangeLastNSecondsModalProps> = ({
6969
label={t('settings.seconds')}
7070
keyboardType="numeric"
7171
mode="outlined"
72-
value={secondsState?.toString()}
72+
defaultValue={secondsState?.toString()}
7373
onChangeText={handleChange}
7474
style={{ backgroundColor: theme.colors.elevation.level3 }}
7575
right={<StyledTextInput.Affix text="s" />}

0 commit comments

Comments
 (0)