-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [lw-12182] add autofocus for all password inputs #1698
base: main
Are you sure you want to change the base?
Conversation
Allure Report
processReports: ✅ test report for 2ebcdebf
|
3d8c82b
to
3560ce0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
@@ -84,6 +89,8 @@ export const SignData = (): React.ReactElement => { | |||
onSubmit={(e) => handleSubmit(e, password)} | |||
error={validPassword === false} | |||
errorMessage={t('browserView.transaction.send.error.invalidPassword')} | |||
id={inputId} | |||
autoFocus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember we had some problems with autoFocus
when singing a regular transaction. Not sure if that's the case but maybe hook usage is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've tested it locally, seems to be working just fine
let's see what would be the results of sdet review?
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any | ||
export const useAutoFocus = (inputRef: any, autoFocus?: boolean): void => { | ||
export const useAutoFocus = <T extends HTMLInputElement | InputRef>( | ||
inputRef: RefObject<T> | string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please rename it to inputRefOrId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here 8c4ce04
packages/staking/package.json
Outdated
@@ -72,6 +72,7 @@ | |||
"react-virtuoso": "^4.6.3", | |||
"recharts": "^2.9.2", | |||
"use-resize-observer": "^9.1.0", | |||
"uuid": "^8.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting: Can we lift this to the top package.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here 8c4ce04
8c4ce04
to
ad4ab25
Compare
ad4ab25
to
2ebcdeb
Compare
|
Checklist
Proposed solution
Use custom hook that queries input by id and calls
.focus()
if found.Testing
nami mode is out of the scope since it was already working there.*
Screenshots
Attach screenshots here if implementation involves some UI changes