Capture tag text on blur if limit not reached

This commit is contained in:
Sam Becker 2025-03-22 17:48:19 -05:00
parent 1fadbda6d2
commit c0e4316e77

View File

@ -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();
}
}}