Capture tag text on blur if limit not reached
This commit is contained in:
parent
1fadbda6d2
commit
c0e4316e77
@ -239,7 +239,12 @@ export default function TagInput({
|
||||
onFocus={() => setShouldShowMenu(true)}
|
||||
onBlur={e => {
|
||||
if (!e.currentTarget.contains(e.relatedTarget)) {
|
||||
setInputText('');
|
||||
// Capture text on blur if limit not yet reached
|
||||
if (inputText && !hasReachedLimit) {
|
||||
addOptions([inputText]);
|
||||
} else {
|
||||
setInputText('');
|
||||
}
|
||||
hideMenu();
|
||||
}
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user