From 5a727a752983f15fb09fd8efd7888b77e2b57f79 Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Sun, 1 Oct 2023 07:13:17 -0400 Subject: [PATCH] [@mantine/core] TagsInput: Fix `onOptionSubmit` not being called when tag is submitted with `Enter` key (#4892) --- src/mantine-core/src/components/TagsInput/TagsInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mantine-core/src/components/TagsInput/TagsInput.tsx b/src/mantine-core/src/components/TagsInput/TagsInput.tsx index 8d85e053341..2fc8f4f2500 100644 --- a/src/mantine-core/src/components/TagsInput/TagsInput.tsx +++ b/src/mantine-core/src/components/TagsInput/TagsInput.tsx @@ -238,6 +238,7 @@ export const TagsInput = factory((_props, ref) => { } if ((!isDuplicate || (isDuplicate && allowDuplicates)) && _value.length < maxTags!) { + onOptionSubmit?.(inputValue); setSearchValue(''); if (inputValue.length > 0) {