diff --git a/docs/examples/basic.tsx b/docs/examples/basic.tsx index b104de1..8e2f2db 100644 --- a/docs/examples/basic.tsx +++ b/docs/examples/basic.tsx @@ -31,6 +31,11 @@ export default () => ( value: 'bamboo', label: 'Bamboo', }, + { + value: 'dark', + label: 'Dark', + disabled: true, + }, { value: 'cat', label: 'Cat', diff --git a/src/Mentions.tsx b/src/Mentions.tsx index 84e978f..f5d5e99 100644 --- a/src/Mentions.tsx +++ b/src/Mentions.tsx @@ -297,7 +297,10 @@ const InternalMentions = forwardRef( }; const selectOption = (option: OptionProps) => { - const { value: mentionValue = '' } = option; + const { value: mentionValue = '', disabled } = option; + if (disabled) { + return; + } const { text, selectionLocation } = replaceWithMeasure(mergedValue, { measureLocation: mergedMeasureLocation, targetText: mentionValue,