Clear Button #183
Replies: 3 comments 2 replies
-
Hey @AlexBasile123 , Regarding the Regarding the const [value, setValue] = useState([]);
const onChange = (newValue) => {
if (newValue.length === 0 && value.length > 0) {
myCustomFunctionForOnClearHere();
}
setValue(newValue);
};
return `<Select onChange={onChange} />`; That said, I would stir away from adding more code that might not be used most of the times. I'm happy that you're using the package and suggesting new ideas, keeping it active. |
Beta Was this translation helpful? Give feedback.
-
What we can do better here is to make it more community friendly. Like promoting plugins, alt wrappers, themes etc. This way we can keep the original package small and fast, with a collection of community add-ons for various needs. Like @icaroscherma suggests, this can easily be implemented on the side. Either by providing a custom callback to the |
Beta Was this translation helpful? Give feedback.
-
Thanks, will give it a try!
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: tbleckert ***@***.***>
Sent: Tuesday, April 27, 2021 4:37:20 AM
To: tbleckert/react-select-search ***@***.***>
Cc: AlexBasile123 ***@***.***>; Mention ***@***.***>
Subject: Re: [tbleckert/react-select-search] Clear Button (#183)
What we can do better here is to make it more community friendly. Like promoting plugins, alt wrappers, themes etc. This way we can keep the original package small and fast, with a collection of community add-ons for various needs. Like @icaroscherma<https://github.com/icaroscherma> suggests, this can easily be implemented on the side. Either by providing a custom callback to the renderValue or by utilising the useSelect hook and build your own wrapper completely.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#183 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AC7QXYO6END6KC2HOZRZ2CTTKZZUBANCNFSM43R6ZPBQ>.
|
Beta Was this translation helpful? Give feedback.
-
Would be really good to have a clear button. Something like an "x" on the right of the search bar.
An event on clicking it as well, onClear.
Don't know if anyone else agrees
Beta Was this translation helpful? Give feedback.
All reactions