React-select: Creatable: when `promptTextCreator` returns only the entered text, changes don't fire on first Enter key press

Created on 1 Nov 2017  路  5Comments  路  Source: JedWatson/react-select

When promptTextCreator of Creatable returns only the user-entered label, you can't select the newly entered value on first Enter keypress, only the second one will trigger changes.

From what I managed to debug, this is due to the new entry being pushed into options prop somewhere along the way, and then failing the uniqueness check.

Minimal reproduction: https://github.com/tmikoss/react-select-creatable-bug-repro/blob/master/src/index.js (repo root is runnable, built by create-react-app).

Most helpful comment

Fixed by #2140

All 5 comments

Faced the same issue.

+1 on this one

yeah, the issue is a pretty annoying one

For what it's worth, I'm using (label) => `${label} ` as a workaround - looks the same to end-user, just makes for some weird code.

Fixed by #2140

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pablote picture pablote  路  3Comments

Meesam picture Meesam  路  3Comments

yrabinov picture yrabinov  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments

coder-guy22296 picture coder-guy22296  路  3Comments