fix: add press enter to add tag

This commit is contained in:
Akuoko Daniel Jnr 2021-03-19 17:05:35 +00:00
parent d9019e67c1
commit 1945354f36
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC

View File

@ -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