How to allow a leading space in CreatableSelect isMulti entries? #5956
-
I am building a replace to a program created 20+ years ago and need to maintain the data structure. For whatever reason, the developer of the original application decided they would use leading and trailing space to indicate a wildcard for a text string. As a result, I need to be able to allow the end users to begin the entries with a white space. Here's what I found:
So, it would seem that the functionality works fine when a leading space is added but it is not intuitive and requires extra steps. Any tips for getting this functionality to work without the extra steps? I am not sure where to begin looking, perhaps on the onKeyDown ? Here's an image, here I have opened a new option for typing, but I can't hit space -- any other key works as described above. Below is my component:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I solved it by adding this at the start of the handleKeyDown event:
|
Beta Was this translation helpful? Give feedback.
I solved it by adding this at the start of the handleKeyDown event: