-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a generic type for suggestion items
- Loading branch information
Showing
1 changed file
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rfgamaral Thanks for adding the generic types here. I'm trying to upgrade from an older Tiptap version, but ran into an issue where this specific generic type doesn't seem correct, since the object selected with
command
need not have the same types as theitems
in the suggestion options. For instance, in Tiptap's official demo https://tiptap.dev/api/nodes/mention, the suggestionitems
are allstring
s, but the selected Mention is of type{id: string}
(which are the attributes of the Mention node):i.e., there's no real restriction that your suggestion needs to return items that have the identical structure to the attributes of a Mention node. In my app's case, the suggestion items have a lot more data in order to render some rich options, beyond just what's stored in a Mention node.
I've opened a PR to fix this #4136