Skip to content

Commit

Permalink
fix(ui): input no padding-right when button on the far right
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed Feb 3, 2023
1 parent b5fa2a2 commit cbedd56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function DInput(props: DInputProps): JSX.Element | null {
{...restProps}
className={getClassName(restProps.className, `${dPrefix}input`, {
[`${dPrefix}input--${size}`]: size,
[`${dPrefix}input--number`]: dType === 'number',
[`${dPrefix}input--button-right`]: dType === 'number' && dNumbetButton && !disabled && !checkNodeExist(dSuffix),
'is-disabled': disabled,
'is-focus': isFocus,
})}
Expand Down
9 changes: 2 additions & 7 deletions packages/ui/src/styles/components/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@
border-color: var(--#{$rd-prefix}color-primary-lighter);
}

@include m(number) {
&:not(.is-disabled) {
padding-right: 0;
@include e(suffix) {
margin-right: calc(var(--#{$rd-prefix}horizontal-space-size) - 1px);
}
}
@include m(button-right) {
padding-right: 0;
}

@include e(input) {
Expand Down

0 comments on commit cbedd56

Please sign in to comment.