-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Initial focus in WorkspaceCompanyCardAccountSelectCardPage #53418
base: main
Are you sure you want to change the base?
Conversation
@DylanDylann Please 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
I can't test this PR directly, because it requires an auth QBO account that has cards. So I used another way to test this problem Disable this line: App/src/pages/workspace/companyCards/WorkspaceCompanyCardAccountSelectCardPage.tsx Line 71 in b80c68e
And make sure that the background highlight is updated when we select another option Screen.Recording.2024-12-03.at.12.08.43.mov |
Checking it, yesterday Callstack had full-day meeting |
@DylanDylann My update: |
Hmm, I am not sure if this bug will happen from the client side (it was caused for me when I hard-code to reproduce the bug) |
Yep, happy to help test with an ad-hoc bulld! |
Hmm, makes sense, let try like this, but Im still wondering why prop for preventing refocus just drops after switching debit to credit and from credit to debit in offline mode and getting back(but that happens only for the first time, hard to reproduce) Also its possible that issue is not reproducible with real data for credit card, I cant test it fully as I was able to mock only debit cards Let it test with adhoc build, thank you @joekaufmanexpensify @mountiny |
🚧 @mountiny has triggered a test build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
@DylanDylann trying to fix it, this one is a bit tricky and couldn't find good solution for now, continuing working! |
… level type to 0 (default card)
@DylanDylann Updated PR with new prop shouldResetFocusedIndex to reset index on changing export type to 0(default card), not to -1 as we had previously each time we changed export type |
@DylanDylann what is your ETA? |
@@ -666,7 +667,7 @@ function BaseSelectionList<TItem extends ListItem>( | |||
// reseting the currrent page to 1 when the user types something | |||
setCurrentPage(1); | |||
|
|||
updateAndScrollToFocusedIndex(newSelectedIndex); | |||
updateAndScrollToFocusedIndex(shouldResetFocusedIndex ? 0 : newSelectedIndex); |
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.
@waterim This function will not be executed because an early return in line 657
(prevTextInputValue === textInputValue && flattenedSections.selectedOptions.length === prevSelectedOptionsLength)
will return true
Details
Fixed Issues
$ #51891
$ #52575 (comment)
PROPOSAL: N/A
Tests
Offline tests
Same as tests
QA Steps
None
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Screen.Recording.2024-12-03.at.02.29.08.mov