Skip to content

Commit

Permalink
fix(NativeSelect&ChipsSelect): fix placeholder length
Browse files Browse the repository at this point in the history
  • Loading branch information
akcent1132 committed Mar 23, 2023
1 parent 6fd6a4f commit d68aea2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
cursor: default;
}

.ChipsInputBase--hasPlaceholder .ChipsInputBase__label {
margin-left: 9px;
margin-right: 0;
}

.ChipsInputBase--hasPlaceholder .ChipsInputBase__el {
white-space: nowrap;
text-overflow: ellipsis;
}

/**
* sizeY COMPACT
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export const ChipsInputBase = <Option extends ChipOption>(props: ChipsInputBaseP
className={classNames(
styles['ChipsInputBase'],
sizeY === SizeType.COMPACT && styles['ChipsInputBase--sizeY-compact'],
!selectedOptions.length && styles['ChipsInputBase--hasPlaceholder'],
className,
)}
ref={getRootRef}
Expand Down
1 change: 1 addition & 0 deletions packages/vkui/src/components/NativeSelect/NativeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const NativeSelect = ({
styles['Select'],
empty && styles['Select--empty'],
multiline && styles['Select--multiline'],
placeholder?.length && styles['Select--hasPlaceholder'],
align &&
{
left: styles['Select--align-left'],
Expand Down
4 changes: 4 additions & 0 deletions packages/vkui/src/components/Select/Select.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
padding-right: 0;
}

.Select--hasPlaceholder .Select__container {
padding-right: 0;
}

.Select--multiline .Select__container {
padding-top: 12px;
padding-bottom: 12px;
Expand Down

0 comments on commit d68aea2

Please sign in to comment.