[v2] formatCreateLabel does not make any effect
See original GitHub issueI want to change the “Create new …” menu option. I am passing formatCreateLabel
handler which returns something like <span style={{ color: "red" }}>Add {inputValue}</span>;
But this does not show up if I type in proper email address (in isValidNewOption handler I test every inputValue with email-validator). The expected "Create new… " option possibly shows up if I remove formatCreateLabel
from the props of <Creatable/>… Is it a bug or thanks god I do something wrong?
Here is my test case:
(example.js)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
How to format value of the React Select - Stack Overflow
I've organized an interface and functionality works, but I have one thing which I don't like. React select requires options in next format:...
Read more >@commercetools-uikit/creatable-select-input - npm
Icon to display on the left of the placeholder text and selected value. Has no effect when isMulti is enabled. aria-label, CreatableProps['aria- ...
Read more >API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >react-select-formatCreateLabel - CodeSandbox
CodeSandbox is an online editor tailored for web applications. ... react-select-formatCreateLabel. 0. 228. 6. ebonowebonow. TemplateReact Select Template ...
Read more >Simple Sitemap – Automatically Generate a Responsive ...
wrapped in strict mode code which doesn't define any globals. It's inside a ... Some versions of I.E. have different rules for clearTimeout...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems that
formatCreateLabel
does not do anything if you have already defined thegetOptionLabel
prop.It looks like
getOptionLabel
takes precedence overformatCreateLabel
.Here is the issue reproduced: https://codesandbox.io/s/recursing-montalcini-3jzu0
It makes sense now. I got confused because the typings for
getOptionLabel
mentioned onlystring
as the return type.