Skip to content

Commit

Permalink
Merge pull request #317 from Lodestone-Team/281-make-rcon-password-ed…
Browse files Browse the repository at this point in the history
…itable-even-when-its-hidden

281 make rcon password editable even when its hidden
  • Loading branch information
jhuang38 authored Jul 23, 2023
2 parents 2c06bd9 + 0e3fcd9 commit bc82947
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dashboard/src/components/Atoms/Config/InputBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ export default function InputBox({

let icons = [];

if (typeModified !== 'password' && touched) {
// enable editing regardless of input type
if (touched) {
icons.push(
<FontAwesomeIcon
icon={faFloppyDisk}
Expand Down Expand Up @@ -200,7 +201,8 @@ export default function InputBox({
typeModified === 'password'
? setTypeModified('text')
: setTypeModified('password');
formRef.current?.reset();
// allow in-progress password to persist between hide/show
// formRef.current?.reset();
}}
key="reveal password"
/>
Expand Down Expand Up @@ -255,7 +257,7 @@ export default function InputBox({
</div>
</div>
<input
value={typeModified === 'password' ? 'xxxxxxxx' : value}
value={value}
placeholder={placeholder}
onChange={onChange}
maxLength={maxLength}
Expand All @@ -267,7 +269,7 @@ export default function InputBox({
onBlur={() => {
setValue(value.trim());
}}
disabled={typeModified === 'password' ? true : disabled}
disabled={disabled}
type={typeModified}
autoComplete={DISABLE_AUTOFILL}
/>
Expand Down

0 comments on commit bc82947

Please sign in to comment.