mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-10 13:32:45 +00:00
Add comma to "submit" buttons
Now comma (`,`) submits a tag, like `Enter`
This commit is contained in:
@@ -17,7 +17,8 @@ const TagInput = ({ unique = true, values = [], ...props }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleInputKeyDown = (evt, value, clear = false) => {
|
const handleInputKeyDown = (evt, value, clear = false) => {
|
||||||
if (evt.key === 'Enter') {
|
if (_.includes(['Enter', ','], evt.key)) {
|
||||||
|
evt.preventDefault();
|
||||||
submitTag(evt.target.value, value);
|
submitTag(evt.target.value, value);
|
||||||
if(clear){ setTemporaryValue(''); }
|
if(clear){ setTemporaryValue(''); }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user