added support for creating tags with space or enter keys
This commit is contained in:
parent
7ff4280b4d
commit
35ca496166
@ -60,7 +60,7 @@ useEffect(() => {
|
||||
};
|
||||
|
||||
const handleInputKeyDown = (e) => {
|
||||
if (e.key === "Enter" && input.trim() !== "") {
|
||||
if ((e.key === "Enter" || e.key === " ") || trimmedInput !== "") {
|
||||
e.preventDefault();
|
||||
const existing = options.find(
|
||||
(opt) => opt.name.toLowerCase() === input.trim().toLowerCase()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user