-
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
Do not focus input after other interactions #48415
Do not focus input after other interactions #48415
Conversation
src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Outdated
Show resolved
Hide resolved
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.
LGTM, but I think we should remove [No QA]
label as this PR should have tests
…/47082-do-not-focus-composer
@eh2077, please review the PR 🙂 |
…/47082-do-not-focus-composer
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'm not sure if we should only avoid keyboard focusing for attachment picker modals.
And I feel that we have been so keen on the auto-focus feature in the past.
} | ||
focus(true); |
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.
By removing this, we also won't focus back to the composer when navigating back from RHP. I just feel that the impact scope might be wider than we expect.
0-web.mp4
0-web.mp4
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.
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.
Hmm, as a user, I'd be happy if keyboard is not focused (no matter the keyboard is focused before or not) when navigating back from attachment picker modals, no matter after uploading an attachment or just cancel to pick an attachment.
For other cases, like picking up an emoji or back from RHP, I think the current behaviour to focus input makes senses to me. I'd like to share following points to support my stance:
- Back the issue itself, the delay is more noticeable only after interactions with system, like open camera or media manager
- Auto-focusing the keyboard makes the user more engaged in chatting, like after picking up an emoji
- IIRC, we have done quite a lot of polishing to this feature in the past.
@mountiny We'd also like to hear your thoughts on this.
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 think I agree with @eh2077 but I would like to give this more exposure, can you please summaarize the problem now and post what you suggest how we should handle it in Slack? I think we should get design team to agree on this
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 totally agree with aligning it with the design team. I will create a post in the open-source channel.
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.
@eh2077, can we move forward with this PR after the discussion in Slack where the guys said that auto-focus feels unnecessary?
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.
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.
Okay, I will do it. Thank you!
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 - 3c4b392.
Refocus.mp4
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.
IOS.mp4
|
||
onEmojiSelected: EmojiPickerAction.OnEmojiSelected; | ||
}; | ||
|
||
function EmojiPickerButton({isDisabled = false, id = '', emojiPickerID = '', shiftVertical = 0, onModalHide, onEmojiSelected}: EmojiPickerButtonProps) { | ||
function EmojiPickerButton({isDisabled = false, id = '', emojiPickerID = '', shiftVertical = 0, onModalHide = () => {}, onEmojiSelected}: EmojiPickerButtonProps) { |
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.
After selecting an emoji, we won't focus back the composer. TBH, I'm feeling a bit disquiet about changing this.
keyboard-dismiss-after-select-emoji.mov
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.
It is also a part of the scope of fixing. From my point of view, it is not a problem and it is good as well. But let's decide #48415 (comment) first.
…/47082-do-not-focus-composer
I'd like to pull the design team @Expensify/design here, so we can hear feedback from them on new changes |
This comment has been minimized.
This comment has been minimized.
@rezkiy37 can you make sure this is up to date with main? maybe your fork main is out of date, not sure why the adhoc build is failing |
@rezkiy37 Why do we need this change? Does it bring benefits for solving the issue here? |
Reviewer Checklist
Screenshots/VideosAndroid: Native0-android.mp4Android: mWeb Chrome0-mobile-chrome.mp4iOS: Native0-ios.mp4iOS: mWeb Safari0-mobile-safari.mp4MacOS: Chrome / Safari0-web.mp4MacOS: Desktop0-web.mp4 |
@rezkiy37 Mobile Safari backdrop attachment picker modal still focus the input Screen.Recording.2024-09-19.at.12.58.12.AM.mov |
https://callstack-hq.slack.com/archives/C01GTK53T8Q/p1726169039084589 |
Hello! |
@JKobrynski Thanks for checking this out! In your clip, I saw the composer border is highlighted. Is it related to the composer focusing? I'll test on my physical iPhone and update soon. |
Tested on physical mobile Safari, backdrop attachment picker modal will not pop up the keyboard, but the composer has a highlight border. 0-RPReplay_Final1727102365.mp4Select an emoji won't open the keyboard, this should be unexpected according to #48415 (comment) 0-RPReplay_Final1727102390.mp4 |
…/47082-do-not-focus-composer
I am back so I will manage the PR 🙂 |
Hey!
Details
Not.a.bug.mp4However, this one is replicable:
So I am working to fix and test it. |
I've fixed when the backdrop attachment picker modal will not pop up the keyboard, but the composer has a highlight border. Commit - a14bd8f. VideoFix.1.mp4 |
…/47082-do-not-focus-composer
@rezkiy37 let us know when this is ready for another full look by c+ |
Cool! I'll retest it by the EOD |
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.
LGTM and tested well!
@rezkiy37 Great job and thank you for your patience!
We did not find an internal engineer to review this PR, trying to assign a random engineer to #47082 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@mountiny All yours |
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.
…/47082-do-not-focus-composer
✋ 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: 9.0.41-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
The PR fixes the Composer focusing and keyboard behavior after interactions with modals.
Fixed Issues
$ #47082
PROPOSAL: #47082 (comment)
Tests
Offline tests
Same as "Tests".
QA Steps
Same as "Tests".
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Android.mp4
Android: mWeb Chrome
Android.Chrome.mp4
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.Safari.mp4
MacOS: Chrome / Safari
Chrome.mp4
MacOS: Desktop
Desktop.mp4