Skip to content

Vizel API / core/src / handleVizelSuggestionEscape

Function: handleVizelSuggestionEscape() ​

ts
function handleVizelSuggestionEscape(event): boolean;

Defined in: packages/core/src/controllers/suggestionContainer.ts:106

Handle the Escape key for suggestion popups.

Returns true if the event was an Escape key press, indicating that the suggestion should be dismissed.

Parameters ​

ParameterTypeDescription
eventKeyboardEventThe keyboard event to check

Returns ​

boolean

true if this was an Escape key press

Example ​

typescript
onKeyDown: ({ event }) => {
  if (handleVizelSuggestionEscape(event)) {
    return true; // Tell Tiptap we handled it
  }
  // Handle other keys...
}

Released under the MIT License.