Remove the default "Create XXX" from options #4612
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @assaf-itzikson, do I understand you correctly, that you don't want the If you just want the option to appear for certain conditions (e.g. value starting with <Creatable isValidNewOption={(inputValue) => inputValue && inputValue.startsWith('@') && /* Check for existing value */} /> |
Beta Was this translation helpful? Give feedback.
Hello @assaf-itzikson,
do I understand you correctly, that you don't want the
Create ...
option? If so, I recommend not using theCreatable
component and instead going for the defaultSelect
component, as the option is crucial for the functionality of theCreatable
component and removing it would just leave unused code in your bundle.If you just want the option to appear for certain conditions (e.g. value starting with
@
), I recommend using theisValidNewOption
prop, which accepts a function as its value. This function gets the value of the search input as its first argument.