Skip to content

Commit

Permalink
[@mantine/core] TagsInput: Fix onOptionSubmit not being called when…
Browse files Browse the repository at this point in the history
… tag is submitted with `Enter` key (#4892)
  • Loading branch information
Yhprum authored Oct 1, 2023
1 parent 2c2e703 commit 5a727a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mantine-core/src/components/TagsInput/TagsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export const TagsInput = factory<TagsInputFactory>((_props, ref) => {
}

if ((!isDuplicate || (isDuplicate && allowDuplicates)) && _value.length < maxTags!) {
onOptionSubmit?.(inputValue);
setSearchValue('');

if (inputValue.length > 0) {
Expand Down

0 comments on commit 5a727a7

Please sign in to comment.