[No QA] [TS migration] Migrate 'useArrowKeyFocusManager.js' hook to TypeScript#29328
Conversation
src/hooks/useArrowKeyFocusManager.ts
Outdated
| shouldExcludeTextAreaNodes = true, | ||
| isActive, | ||
| }) { | ||
| }: Config): [number, (index: number) => void] { |
There was a problem hiding this comment.
@kubabutkiewicz, maybe put it into a separate type
src/hooks/useArrowKeyFocusManager.ts
Outdated
| * @param {Boolean} [config.shouldExcludeTextAreaNodes] – Whether arrow keys should have any effect when a TextArea node is focused | ||
| * @param {Boolean} [config.isActive] – Whether the component is ready and should subscribe to KeyboardShortcut | ||
| * @returns {Array} | ||
| * @param config |
There was a problem hiding this comment.
This line can be removed
| @@ -2,19 +2,29 @@ import {useState, useEffect, useCallback, useMemo} from 'react'; | |||
| import useKeyboardShortcut from './useKeyboardShortcut'; | |||
There was a problem hiding this comment.
Maybe migrate useKeyboardShortcut hook in this PR as well?
There was a problem hiding this comment.
@blazejkustra useKeyboardShortcut is migrated in this PR but its blocked by this PR
…s-migration/useArrowKeyFocusManager/hook
|
This looks good to me! A couple minor questions, no changes needed I think:
Thanks! |
Yes, C+ should do the reviewer checklist
No need, it can be migrated separately
@kubabutkiewicz Can you add some QA steps? |
|
|
@rushatgabhane @ One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Added @rushatgabhane for C+ review, then will take one more look! |
|
thank you |
|
Bump on the review when you have time @rushatgabhane - thank you! |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-25.at.23.49.40.movMobile Web - SafariScreen.Recording.2023-10-26.at.00.43.03.movDesktopScreen.Recording.2023-10-26.at.01.45.18.movAndroidScreen.Recording.2023-10-26.at.01.46.55.mov |
dangrous
left a comment
There was a problem hiding this comment.
Just one question - the default value on new line 30 - onFocusedIndexChange = () => {}, - is that going to pose a problem with the onFocusedIndexChange?: (index: number) => void; type since it doesn't have an index parameter?
If that's fine, though, I'm good to merge this! Thanks.
…s-migration/useArrowKeyFocusManager/hook
@dangrous it will not cause any problem since |
|
I wasn't sure if we would get errors since the default did not match the type. But that would show up on compile so I think we're okay? |
|
✋ 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/dangrous in version: 1.3.94-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.94-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.94-2 🚀
|
|
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.95-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.95-9 🚀
|


Details
Fixed Issues
$ #24947
Tests
Offline tests
QA Steps
PR 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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)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
android.mp4
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4