diff --git a/components/apolloTable/component/base/edit/search/index.less b/components/apolloTable/component/base/edit/search/index.less index 0b0908b5be956342972621038b63bf95783e0a60..a536dd8011889d2b278e8ae593de8a3f8faf1768 100644 --- a/components/apolloTable/component/base/edit/search/index.less +++ b/components/apolloTable/component/base/edit/search/index.less @@ -8,8 +8,15 @@ border-radius: 0; display: flex; align-items: center; + height: auto; } :global(.ant-select-selection__rendered) { width: 100%; } } +.searchDropdown { + overflow: auto; + :global(.ant-select-dropdown-menu) { + max-height: none; + } +} diff --git a/components/apolloTable/component/base/edit/search/index.tsx b/components/apolloTable/component/base/edit/search/index.tsx index e454a328ecbde4cc6056d63a60c03c1af2fcec8d..fe04005cb2748411f1631a79de96f0c43ba14d04 100644 --- a/components/apolloTable/component/base/edit/search/index.tsx +++ b/components/apolloTable/component/base/edit/search/index.tsx @@ -7,8 +7,16 @@ import { onBlurFn } from '../onBlurFn'; import s from './index.less'; export const ApolloSearch = (props: ApolloSearchProps) => { - const { onChange, maxCount, isMultiple, request } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'request', 'maxCount']); + const { onChange, maxCount, isMultiple, request, maxPopHeight } = props; + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'isMultiple', + 'options', + 'request', + 'maxCount', + 'maxPopHeight', + ]); const isOpen: any = useRef(); if (isMultiple) { selfProps.mode = 'multiple'; @@ -45,6 +53,10 @@ export const ApolloSearch = (props: ApolloSearchProps) => { onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn} onChange={changeValue} initDataType="onfocus" + dropdownClassName={s.searchDropdown} + dropdownStyle={{ + maxHeight: maxPopHeight, + }} /> ); }; diff --git a/components/apolloTable/component/base/edit/select/index.tsx b/components/apolloTable/component/base/edit/select/index.tsx index 328a9e88741579c5cd3b90c33933e5aa95f50893..03c8c7f88fa260b07102dd972ac68c90ee23bb59 100644 --- a/components/apolloTable/component/base/edit/select/index.tsx +++ b/components/apolloTable/component/base/edit/select/index.tsx @@ -37,6 +37,7 @@ export const ApolloSelect = (props: ApolloSelectProps) => { {...selfProps} onChange={changeValue} onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn} + dropdownClassName={styles.selectDropdown} dropdownStyle={{ maxHeight: maxPopHeight, }} diff --git a/components/apolloTable/component/base/edit/select/styles.less b/components/apolloTable/component/base/edit/select/styles.less index ed123d1a7341958c76fbf05f0d51286b846daca1..d097d80108b89dd565a7ffc0efe2b18d6a84a292 100644 --- a/components/apolloTable/component/base/edit/select/styles.less +++ b/components/apolloTable/component/base/edit/select/styles.less @@ -18,3 +18,9 @@ align-items: center; } } +.selectDropdown{ + overflow: auto; + :global(.ant-select-dropdown-menu) { + max-height: none; + } +} diff --git a/components/apolloTable/component/base/extra/associationSearch/index.tsx b/components/apolloTable/component/base/extra/associationSearch/index.tsx index aec8317c194d6fc913c229f8e61793b7d68c3c20..d32d190c01aa82e7b6437c6b5db9928014bfb1d8 100644 --- a/components/apolloTable/component/base/extra/associationSearch/index.tsx +++ b/components/apolloTable/component/base/extra/associationSearch/index.tsx @@ -227,7 +227,7 @@ class AssociationSearch extends React.Component { render() { const { data, value } = this.state; - const { selfCom, autoFocus, onChange, maxPopHeight, ...rest } = this.props; + const { selfCom, autoFocus, onChange, ...rest } = this.props; return ( {({ locale }: any) => { @@ -243,9 +243,6 @@ class AssociationSearch extends React.Component { onChange={this.handleChange} onFocus={this.onFocus} onBlur={this.onBlur} - dropdownStyle={{ - maxHeight: maxPopHeight, - }} > {data.map((d: any) => { return (