Skip to content

Commit cbedd56

Browse files
committed
fix(ui): input no padding-right when button on the far right
1 parent b5fa2a2 commit cbedd56

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/ui/src/components/input/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function DInput(props: DInputProps): JSX.Element | null {
171171
{...restProps}
172172
className={getClassName(restProps.className, `${dPrefix}input`, {
173173
[`${dPrefix}input--${size}`]: size,
174-
[`${dPrefix}input--number`]: dType === 'number',
174+
[`${dPrefix}input--button-right`]: dType === 'number' && dNumbetButton && !disabled && !checkNodeExist(dSuffix),
175175
'is-disabled': disabled,
176176
'is-focus': isFocus,
177177
})}

packages/ui/src/styles/components/input.scss

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@
4444
border-color: var(--#{$rd-prefix}color-primary-lighter);
4545
}
4646

47-
@include m(number) {
48-
&:not(.is-disabled) {
49-
padding-right: 0;
50-
@include e(suffix) {
51-
margin-right: calc(var(--#{$rd-prefix}horizontal-space-size) - 1px);
52-
}
53-
}
47+
@include m(button-right) {
48+
padding-right: 0;
5449
}
5550

5651
@include e(input) {

0 commit comments

Comments
 (0)