diff --git a/src/plugins/toolbar/primitives/DialogButton.tsx b/src/plugins/toolbar/primitives/DialogButton.tsx index 34e325f9..702f5aa4 100644 --- a/src/plugins/toolbar/primitives/DialogButton.tsx +++ b/src/plugins/toolbar/primitives/DialogButton.tsx @@ -120,11 +120,6 @@ const DialogForm: React.FC<{ } }) - const onSubmitEH = (e: React.FormEvent) => { - e.preventDefault() - onSubmitCallback(selectedItem || '') - } - const onKeyDownEH = React.useCallback( (e: React.KeyboardEvent) => { if (e.key === 'Escape') { @@ -150,6 +145,11 @@ const DialogForm: React.FC<{ } } + const onSubmitEH = (e: React.FormEvent) => { + e.preventDefault() + onSubmitCallback((inputProps as { value: string }).value) + } + const dropdownIsVisible = isOpen && items.length > 0 return (