Skip to content

Commit

Permalink
style(SearchSelect): 样式调整,下拉菜单比搜索框长 #652 (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr-z committed Mar 18, 2022
1 parent 849b22f commit 1982a14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions packages/react-search-select/README.md
Expand Up @@ -51,7 +51,7 @@ const Demo = () => {
<Row>
<SearchSelect
mode="multiple"
style={{ width: 176 }}
style={{ width: 200 }}
showSearch={true}
labelInValue={true}
maxTagCount={6}
Expand All @@ -72,7 +72,7 @@ const Demo = () => {
<Row>
<SearchSelect
mode="single"
style={{ width: 176 }}
style={{ width: 200 }}
showSearch={true}
labelInValue={true}
maxTagCount={6}
Expand Down Expand Up @@ -196,12 +196,12 @@ const Demo = () => {
>
{({ fields, state, canSubmit }) => {
return (
<div>
<Row gutter={20}>
<Col fixed>{fields.selectField}</Col>
<div style={{ marginLeft:10}}>
<Row >
<Col fixed style={{width:200}}>{fields.selectField}</Col>
</Row>
<Row gutter={20}>
<Col fixed>{fields.selectSingle}</Col>
<Row>
<Col fixed style={{width:200}}>{fields.selectSingle}</Col>
</Row>
<Row>
<Col fixed>
Expand Down
5 changes: 3 additions & 2 deletions packages/react-search-select/src/index.tsx
Expand Up @@ -209,6 +209,7 @@ export default function SearchSelect(props: SearchSelectProps) {
className={cls}
trigger="click"
style={{ marginTop: 5 }}
overlayStyl={{ width: 100 }}
disabled={option && option.length > 0 ? false : true}
{...others}
onVisibleChange={onVisibleChange}
Expand All @@ -219,9 +220,9 @@ export default function SearchSelect(props: SearchSelectProps) {
style={{
minHeight: 25,
maxHeight: 280,
minWidth: 200,
minWidth: style?.width ?? 200,
overflowY: 'scroll',
width: divRef.current ? divRef.current.offsetWidth : 'auto',
width: style?.width,
}}
>
{!option || option.length === 0 ? (
Expand Down

0 comments on commit 1982a14

Please sign in to comment.