mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
fix(input-number): without controls suffix style (#50450)
Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
4235d117f2
commit
bda8cb0a76
@ -16,4 +16,12 @@ describe('suffix', () => {
|
||||
fireEvent.click(container.querySelector('i')!);
|
||||
expect(mockFocus).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should has classname when without controls', () => {
|
||||
const { container } = render(<InputNumber suffix={<i>antd</i>} controls={false} />);
|
||||
|
||||
expect(
|
||||
container.querySelector('.ant-input-number-affix-wrapper-without-controls'),
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@ -171,6 +171,7 @@ const InputNumber = React.forwardRef<HTMLInputElement, InputNumberProps>((props,
|
||||
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
|
||||
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
|
||||
[`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
|
||||
[`${prefixCls}-affix-wrapper-without-controls`]: controls === false,
|
||||
},
|
||||
hashId,
|
||||
),
|
||||
|
@ -469,7 +469,7 @@ const genAffixWrapperStyles: GenerateStyle<InputNumberToken> = (token: InputNumb
|
||||
width: token.handleWidth,
|
||||
opacity: 1,
|
||||
},
|
||||
[`&:hover ${componentCls}-suffix`]: {
|
||||
[`&:not(${componentCls}-affix-wrapper-without-controls):hover ${componentCls}-suffix`]: {
|
||||
marginInlineEnd: token.calc(token.handleWidth).add(paddingInline).equal(),
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user