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
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
Unknown Object (File)
Sep 23 2024, 3:56 PM

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #17880)

Great idea forwarding the ref!

web/modals/threads/thread-picker-modal.react.js
76 ↗(On Diff #17880)

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