Prevent enter key event of button if the focused element is clickable#32549
Prevent enter key event of button if the focused element is clickable#32549mountiny merged 3 commits intoExpensify:mainfrom
Conversation
| const roles: string[] = Object.values(CONST.ACCESSIBILITY_ROLE); | ||
| const shouldDisableEnterShortcut = roles.includes(activeElement?.role ?? '') && activeElement?.role !== CONST.ACCESSIBILITY_ROLE.TEXT; |
There was a problem hiding this comment.
The name of const roles is confusing. Let's rename it to accessibilityRoles or remove it like the below
| const roles: string[] = Object.values(CONST.ACCESSIBILITY_ROLE); | |
| const shouldDisableEnterShortcut = roles.includes(activeElement?.role ?? '') && activeElement?.role !== CONST.ACCESSIBILITY_ROLE.TEXT; | |
| const shouldDisableEnterShortcut = Object.values(CONST.ACCESSIBILITY_ROLE).includes(activeElement?.role ?? '') && activeElement?.role !== CONST.ACCESSIBILITY_ROLE.TEXT; |
There was a problem hiding this comment.
Object.values(CONST.ACCESSIBILITY_ROLE).includes(activeElement?.role ?? '') && activeElement?.role !== CONST.ACCESSIBILITY_ROLE.TEXT;
@ArekChr This update will have ts error so renamed variable
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromeandroid.web.chrome.moviOS: Nativeios.moviOS: mWeb Safariios.web.safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
ArekChr
left a comment
There was a problem hiding this comment.
All works! Thanks for PR
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.9-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.9-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.9-5 🚀
|
Details
Prevent enter key event of button if the focused element is clickable
Fixed Issues
$ #32294
PROPOSAL: #32294 (comment)
Tests
CancelbuttonReimbursementAccountPageOffline tests
Same as above
QA Steps
CancelbuttonReimbursementAccountPagePR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2023-12-06.at.15.53.29.mov
Android: mWeb Chrome
Screen.Recording.2023-12-06.at.15.37.05.mov
iOS: Native
Screen.Recording.2023-12-06.at.15.55.05.mov
iOS: mWeb Safari
Screen.Recording.2023-12-06.at.15.28.08.mov
MacOS: Chrome / Safari
Screen.Recording.2023-12-06.at.15.22.42.mov
MacOS: Desktop
Screen.Recording.2023-12-06.at.16.00.07.mov