-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add select on focus to text field #1072
Conversation
749d665
to
bd3051d
Compare
@@ -61,6 +61,7 @@ export interface TextFieldBaseProps<X> | |||
// Replaces empty input field and placeholder with node | |||
// IE: Multiselect renders list of selected items in the input field | |||
unfocusedPlaceholder?: ReactNode; | |||
selectOnFocus?: boolean; |
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.
Hey @JonnCharpentier , just curious, but I'm getting back into things--what ticket/request was this change for? I'm wondering if we could add an in-source comment to this, like:
/** Disable select on focus, i.e. ...description of the use case you're supporting... */
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.
This change is for this ticket: https://app.shortcut.com/homebound-team/story/56770/improve-add-new-attribute-ux
Basically Dave want us to auto swap into the text field when the user search don't have matches, but also auto-focus the field for the user to continue typing into the text field, this change optionally removes the Select all on focus, so that when we swap into the text field, the field is focus but not selected.
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, that makes sense -- the comment as-is does not really explain "why", imo it is just restating "what" happens; can you reword it to be:
/** Allow focusing without selecting, i.e. to let the user keep typing after we've pre-filled text + called focus, like the Add New component. */
bd3051d
to
03e5d5f
Compare
## [2.368.0](v2.367.0...v2.368.0) (2024-09-23) ### Features * Add select on focus to text field ([#1072](#1072)) ([6cc4009](6cc4009))
🎉 This PR is included in version 2.368.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.