diff --git a/.changeset/tender-items-visit.md b/.changeset/tender-items-visit.md new file mode 100644 index 0000000000..2084fe4250 --- /dev/null +++ b/.changeset/tender-items-visit.md @@ -0,0 +1,5 @@ +--- +"@tiptap/suggestion": patch +--- + +Dropdowns from the suggestion utility couldn't be closed with the `Esc` key diff --git a/packages/suggestion/src/suggestion.ts b/packages/suggestion/src/suggestion.ts index 68b483600a..8380219688 100644 --- a/packages/suggestion/src/suggestion.ts +++ b/packages/suggestion/src/suggestion.ts @@ -197,7 +197,7 @@ export function Suggestion({ const handleStart = started || (moved && changed) const handleChange = changed || moved - const handleExit = stopped + const handleExit = stopped || (moved && changed) // Cancel when suggestion isn't active if (!handleStart && !handleChange && !handleExit) {