mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
fix: InputNumber handleVisible token should work as expected (#51728)
This commit is contained in:
parent
9cc7dc1e15
commit
c3b75819a9
@ -250,7 +250,7 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
|
||||
position: 'absolute',
|
||||
insetBlockStart: 0,
|
||||
insetInlineEnd: 0,
|
||||
width: 0,
|
||||
width: token.handleVisibleWidth,
|
||||
opacity: handleOpacity,
|
||||
height: '100%',
|
||||
borderStartStartRadius: 0,
|
||||
|
@ -55,17 +55,22 @@ export interface ComponentToken extends SharedComponentToken {
|
||||
* @internal
|
||||
*/
|
||||
handleOpacity: number;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
handleVisibleWidth: number;
|
||||
}
|
||||
|
||||
export type InputNumberToken = FullToken<'InputNumber'> & SharedInputToken;
|
||||
|
||||
export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) => {
|
||||
const handleVisible = token.handleVisible ?? 'auto';
|
||||
const handleWidth = token.controlHeightSM - token.lineWidth * 2;
|
||||
|
||||
return {
|
||||
...initComponentToken(token),
|
||||
controlWidth: 90,
|
||||
handleWidth: token.controlHeightSM - token.lineWidth * 2,
|
||||
handleWidth,
|
||||
handleFontSize: token.fontSize / 2,
|
||||
handleVisible,
|
||||
handleActiveBg: token.colorFillAlter,
|
||||
@ -76,5 +81,6 @@ export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) =>
|
||||
handleHoverColor: token.colorPrimary,
|
||||
handleBorderColor: token.colorBorder,
|
||||
handleOpacity: handleVisible === true ? 1 : 0,
|
||||
handleVisibleWidth: handleVisible === true ? handleWidth : 0,
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user