-
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 loose focus for Web/Desktop #16673
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
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.
Looking good, thanks, @narefyev91 I think we could improve the testing steps to also include what to verify by the QA team. Could you make the changes also platform specific.
Sure - updated description based on platforms |
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.
Looks good to me, all yours @0xmiroslav Thanks!
Just confirming this one: |
@0xmiroslav @mountiny resolved latest comment |
Code looks good. Testing now. |
Bug? |
Should it be selectable? oO |
It's selectable in production. Also when not focused |
selectable.mov |
in that case input should loose focus if we interact with header? @0xmiroslav |
I am not quite sure but I think at least when interact with header title. |
Yeah we should mimic the behaviour in production |
Ok, but not sure if it will be possible to still use onBlur handler - event from onBlur will not contain information about something which placed before text input in DOM tree. |
@0xmiroslav @mountiny came to one more solution which mostly covering all possible cases and not make any flickering regressions as well, and make header selectable
We add new nativeID, and indicate if some clicks exactly in the dark area, if yes and nativeID is equal to which section we clicked - we will not remove focus. Clicking on currency selector and button will not make any UI visual issues because both have nativeID and they will not be pass inside if condition. |
we can move this only to this wrapper
Not really sure why it's started to be complex, we have one function which will cover any case now, and will cover if we add any new component to this page, if anything on the page will be changed we will need to add e.preventDefault rather that controlling based on nativeIDs. Moving e.preventDefault is fixing corner case rather than general solution cc @0xmiroslav , @mountiny |
Lets try to get this merged today, I would not worry about some complexity at this point :D |
It's same we will need to add nativeID. So no perfect general solution
So I agree with this and leave gap case as is for now. |
but why do we need to rollback commit if a new one covers also possibility not loose focus between numbers and make flow working identical ? |
I know that works, but I feel like it's overkill. Any other part in our codebase which added multiple nativeIDs to handle such case? |
@0xmiroslav @mountiny ok what would be the last step - i rollback last commit and we good to go? |
Would that mean clicking between the numpads on mobile will leave focus? If yes we should not do that, thats a major UX bad |
that means - that on mobile web - when user click between buttons - input will loose focus (if i revert that change) |
Yes we dont want that, its easy to fat finger between the numbers and it will be bad UX if user will have to click back to the number |
ok then let's go with current solution |
So do not revert |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari-new.movDesktopdesktop.moviOSios.mp4Androidandroid.movLast part of mChrome video: blurred when click offline view |
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.
Thank you both for getting this over the finish line
🚀 Deployed to staging by https://github.com/mountiny in version: 1.2.93-3 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.93-4 🚀
|
Details
Amount field loose focus clicking outside
Fixed Issues
$ #16511
$ #16511 (comment)
Tests
Offline tests
Nothing needed
QA Steps
Platform specific steps:
Web/Desktop:
Expected result - amount input will not loose focus
mWeb:
Expected results - amount input will be automatically focused - new typed number will be shown
Native IOS, Android:
Expected result - amount input will not loose focus
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
Web
8mb.video-ENB-55UJCUZI.mp4
Mobile Web - Chrome
android-web.mov
Mobile Web - Safari
ios-web.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov