Skip to content

Commit

Permalink
Merge pull request #67 from KasperskyLab/fix/select-component-props
Browse files Browse the repository at this point in the history
fix: remove unnecessary select styles
  • Loading branch information
vostrik authored Jul 2, 2024
2 parents f7bf126 + 044cc22 commit c47f995
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
31 changes: 23 additions & 8 deletions packages/kaspersky-components/src/select/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { sbHideControls } from '@helpers/storybookHelpers'
import { withMeta } from '@helpers/hocs/MetaComponent/withMeta'
import Docs from './SelectDocs'
import { Toggle } from '@src/toggle'
import { Label } from '@src/label'
import { Field } from '@src/field'
import { Link } from '@src/link'
import { P, Text } from '@src/typography'
import { Tag } from '@src/tag'
Expand Down Expand Up @@ -201,6 +201,25 @@ export const WithHeader: Story = {
}
}

export const WithShowSearchAndAllowClear: Story = {
render: (args: SelectProps) => {
return (
<div style={{ width: '550px' }}>
<P>No mode</P>
<Field control={<Select {...args} />} />
<P>Tags mode</P>
<Field control={<Select {...args} mode="tags" />} />
<P>Multiple mode</P>
<Field control={<Select {...args} mode="multiple" />} />
</div>
)
},
args: {
allowClear: true,
showSearch: true
}
}

export const CustomDropdown: Story = {
render: (args: SelectProps) => {
const [checked, setChecked] = React.useState(false)
Expand Down Expand Up @@ -231,20 +250,16 @@ export const Tags: Story = {
return (
<div style={{ width: '550px' }}>
<P>Tags mode</P>
<Label htmlFor={args.id}>
<Select
{...args}
/>
</Label>
<Field control={<Select {...args} />} />
<P>Tags mode with allowNonUniqueValues</P>
<Label htmlFor={args.id + '1'}>
<Field control={
<Select
id={args.id + '1'}
{...args}
allowNonUniqueValues={true}
defaultValue={['MyTag', 'MyTag']}
/>
</Label>
} />
</div>
)
},
Expand Down
4 changes: 0 additions & 4 deletions packages/kaspersky-components/src/select/selectCss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ export const selectCss = css`
}
}
&.ant-select-show-search:not(.ant-select-multiple) .ant-select-clear {
display: none;
}
&.ant-select-single {
.ant-select-selector {
padding: 6px 36px 6px 12px;
Expand Down

0 comments on commit c47f995

Please sign in to comment.