Page MenuHomePhabricator

[web] focus search input for thread picker modal
ClosedPublic

Authored by ginsu on Oct 24 2022, 1:36 PM.
Tags
None
Referenced Files
F3247736: D5471.diff
Fri, Nov 15, 6:33 AM
Unknown Object (File)
Sat, Nov 2, 11:23 PM
Unknown Object (File)
Oct 13 2024, 6:02 AM
Unknown Object (File)
Oct 7 2024, 5:49 AM
Unknown Object (File)
Oct 7 2024, 5:49 AM
Unknown Object (File)
Oct 7 2024, 5:49 AM
Unknown Object (File)
Oct 7 2024, 5:49 AM
Unknown Object (File)
Oct 7 2024, 5:47 AM

Details

Summary

The search input in the Thread Picker Modal now focuses whenever the thread picker opens up. This saves the user a click and is what we do on native


Linear Task: ENG-2051

Test Plan

Please watch the demos to see the changes I made. Please note that only the Search component in the Thread Picker Modal has this focus change, and other places that use the Search components will remain the same

Before:

After:

Diff Detail

Repository
rCOMM Comm
Branch
eng-2051
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Oct 24 2022, 1:49 PM
ashoat requested changes to this revision.Oct 24 2022, 2:09 PM
ashoat added inline comments.
web/components/search.react.js
49–54

Great idea forwarding the ref!

web/modals/threads/thread-picker-modal.react.js
76

You should never use an effect without specifying a dep list. In this case, you're causing the field to focus on every single render. If you mean to only do it in componentDidMount, you should provide an empty dep list instead ([])

This revision now requires changes to proceed.Oct 24 2022, 2:09 PM

addressed ashoat's comments

This revision is now accepted and ready to land.Oct 26 2022, 12:53 PM