Skip to main content

hide-suggest

Description

Fires when the suggestion dropdown closes

The event fires when any of these happen:

  • the user picks an item from the dropdown
  • the user presses Escape
  • the cursor leaves the trigger context (for example, on Backspace past the trigger character)
  • the current query returns no matches

Usage

"hide-suggest": () => boolean | void;

Parameters

The hide-suggest event callback does not receive any parameters.

info

To handle internal events, use Event Bus methods.

Example

// initialize RichText
const editor = new richtext.Richtext("#root", {
// configuration properties
});
// subscribe to the "hide-suggest" event
editor.api.on("hide-suggest", () => {
console.log("Suggestion dropdown closed");
});

Change log: The event was added in v2.1

Related sample: RichText. Mentions, tags, and async lookup

Related articles: Mentions and tags