This commit is contained in:
Nate Kelley 2025-09-30 15:16:06 -06:00
parent 6a8b0210f8
commit 7ab328abb5
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 1 additions and 12 deletions

View File

@ -388,17 +388,7 @@ export const DynamicItems: Story = {
() => () =>
createMentionSuggestionExtension({ createMentionSuggestionExtension({
trigger: '!', trigger: '!',
items: ({ query }) => { items: dynamicItems,
// This function is called each time suggestions are needed,
// so it will always get the current dynamicItems state
console.log(
'Getting dynamic items for query:',
query,
'Current items:',
dynamicItems.length
);
return defaultQueryMentionsFilter(query, dynamicItems);
},
pillStyling: { pillStyling: {
className: () => { className: () => {
return 'bg-gradient-to-r from-purple-100 to-pink-100 border-purple-300 text-purple-700 hover:from-purple-200 hover:to-pink-200'; return 'bg-gradient-to-r from-purple-100 to-pink-100 border-purple-300 text-purple-700 hover:from-purple-200 hover:to-pink-200';
@ -419,7 +409,6 @@ export const DynamicItems: Story = {
return ( return (
<div className="space-y-4 w-full max-w-2xl"> <div className="space-y-4 w-full max-w-2xl">
<MentionInput <MentionInput
key={`dynamic-${dynamicItems.length}`}
ref={mentionInputRef} ref={mentionInputRef}
className="min-w-64 p-3 border border-gray-200 rounded-lg" className="min-w-64 p-3 border border-gray-200 rounded-lg"
placeholder="Type ! to see dynamic mentions..." placeholder="Type ! to see dynamic mentions..."