mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-23 14:07:20 +03:00
fix: add press enter to add tag
This commit is contained in:
parent
d9019e67c1
commit
1945354f36
@ -520,6 +520,12 @@ export const Tag = ({
|
||||
|
||||
const _handleChange = (e) => setValue(e.target.value.toLowerCase());
|
||||
|
||||
const _handleKeyDown = (e) => {
|
||||
if (e.key === "Enter") {
|
||||
_handleAdd(value);
|
||||
}
|
||||
};
|
||||
|
||||
const _handleFocus = () => setOpen(true);
|
||||
|
||||
return (
|
||||
@ -533,6 +539,7 @@ export const Tag = ({
|
||||
placeholder={placeholder ? placeholder : null}
|
||||
value={value}
|
||||
onChange={_handleChange}
|
||||
onKeyDown={_handleKeyDown}
|
||||
onFocus={_handleFocus}
|
||||
/>
|
||||
<Dropdown
|
||||
|
Loading…
Reference in New Issue
Block a user