Skip to content

Commit

Permalink
fix(suggestion): dropdown can now be closed with Esc (#4380) (#5544)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfgamaral committed Aug 23, 2024
1 parent fafb5ad commit daad533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tender-items-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/suggestion": patch
---

Dropdowns from the suggestion utility couldn't be closed with the `Esc` key
2 changes: 1 addition & 1 deletion packages/suggestion/src/suggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function Suggestion<I = any, TSelected = any>({

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) {
Expand Down

0 comments on commit daad533

Please sign in to comment.