Skip to content

Commit

Permalink
fix: disabled should work on affix
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc committed Dec 18, 2023
1 parent ebf9f5c commit 489582f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Mentions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ const Mentions = forwardRef<MentionsRef, MentionsProps>(
onChange,
classNames: classes,
className,
disabled,
...rest
},
ref,
Expand Down Expand Up @@ -520,6 +521,7 @@ const Mentions = forwardRef<MentionsRef, MentionsProps>(
handleReset={handleReset}
className={className}
classNames={classes}
disabled={disabled}
>
<InternalMentions
className={classes?.mentions}
Expand Down
7 changes: 7 additions & 0 deletions tests/Mentions.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,11 @@ describe('Mentions', () => {
rerender(createMentions({ ref, className: 'test-cls', suffix: '123' }));
expect(container.firstChild).toHaveClass('test-cls');
});

it('disabled should work on affix wrapper', () => {
const { container } = render(
createMentions({ disabled: true, suffix: '1' }),
);
expect(container.firstChild).toHaveClass('rc-mentions-disabled');
});
});

0 comments on commit 489582f

Please sign in to comment.