You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, React-Select does not have a built-in option to automatically clear the selected value when the component gains focus. This feature could be beneficial in certain use cases where users want a clean slate upon interacting with the Select component.
Rationale:
Consistency and Standardization: Implementing this behavior as an opt-in feature within React-Select would provide a consistent and predictable experience for users across different applications.
Encapsulation and Maintainability: Encapsulating the "clear on focus" logic within the component would simplify maintenance and updates in the future.
Flexibility: Offering this as an optional feature (e.g., through a clearOnFocus prop) would empower users to choose whether they desire this behavior, accommodating diverse use cases.
Proposed Implementation:
One potential implementation could involve introducing a new prop, clearOnFocus, to the Select component. When set to true, the selected value would be automatically cleared whenever the component receives focus.
Discussion Points:
Would this feature be valuable to the React-Select community?
Are there any potential drawbacks or concerns regarding this behavior?
What would be the preferred implementation approach?
I'm open to feedback and suggestions on how to best integrate this feature into React-Select.
Additional Notes:
I'm willing to contribute a pull request to implement this feature if there is interest from the maintainers and community.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, React-Select does not have a built-in option to automatically clear the selected value when the component gains focus. This feature could be beneficial in certain use cases where users want a clean slate upon interacting with the Select component.
Rationale:
clearOnFocus
prop) would empower users to choose whether they desire this behavior, accommodating diverse use cases.Proposed Implementation:
clearOnFocus
, to theSelect
component. When set totrue
, the selected value would be automatically cleared whenever the component receives focus.Discussion Points:
I'm open to feedback and suggestions on how to best integrate this feature into React-Select.
Additional Notes:
I'm willing to contribute a pull request to implement this feature if there is interest from the maintainers and community.
Beta Was this translation helpful? Give feedback.
All reactions