From 489582feed443103d0513bc0eaef94ae242df89e Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 18 Dec 2023 15:14:22 +0800 Subject: [PATCH] fix: disabled should work on affix --- src/Mentions.tsx | 2 ++ tests/Mentions.spec.tsx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/Mentions.tsx b/src/Mentions.tsx index a37596e..6683310 100644 --- a/src/Mentions.tsx +++ b/src/Mentions.tsx @@ -490,6 +490,7 @@ const Mentions = forwardRef( onChange, classNames: classes, className, + disabled, ...rest }, ref, @@ -520,6 +521,7 @@ const Mentions = forwardRef( handleReset={handleReset} className={className} classNames={classes} + disabled={disabled} > { 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'); + }); });