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)
Tue, Nov 26, 5:15 PM
Unknown Object (File)
Tue, Nov 26, 5:15 PM
Unknown Object (File)
Sun, Nov 24, 11:06 PM
Unknown Object (File)
Sun, Nov 24, 11:06 PM
Unknown Object (File)
Nov 15 2024, 9:43 AM
Unknown Object (File)
Nov 15 2024, 8:46 AM
Unknown Object (File)
Nov 15 2024, 8:46 AM
Unknown Object (File)
Nov 15 2024, 6:33 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
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 ↗(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