Commit a2cecbaf authored by zhangwenshuai's avatar zhangwenshuai

修改search和select的下拉样式

parent d887e67d
......@@ -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;
}
}
......@@ -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,
}}
/>
);
};
......@@ -37,6 +37,7 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
{...selfProps}
onChange={changeValue}
onDropdownVisibleChange={selfProps.mode === 'multiple' ? multipleBlurFn : singleBlurFn}
dropdownClassName={styles.selectDropdown}
dropdownStyle={{
maxHeight: maxPopHeight,
}}
......
......@@ -18,3 +18,9 @@
align-items: center;
}
}
.selectDropdown{
overflow: auto;
:global(.ant-select-dropdown-menu) {
max-height: none;
}
}
......@@ -227,7 +227,7 @@ class AssociationSearch extends React.Component<Props, State> {
render() {
const { data, value } = this.state;
const { selfCom, autoFocus, onChange, maxPopHeight, ...rest } = this.props;
const { selfCom, autoFocus, onChange, ...rest } = this.props;
return (
<Consumer>
{({ locale }: any) => {
......@@ -243,9 +243,6 @@ class AssociationSearch extends React.Component<Props, State> {
onChange={this.handleChange}
onFocus={this.onFocus}
onBlur={this.onBlur}
dropdownStyle={{
maxHeight: maxPopHeight,
}}
>
{data.map((d: any) => {
return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment