mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:17:00 +00:00
fix: should limit submenu height (#2227)
This commit is contained in:
parent
2e8c14e0d6
commit
1fb15de29a
@ -58,6 +58,7 @@ SchemaInitializer.Button = observer(
|
|||||||
const [searchValue, setSearchValue] = useState('');
|
const [searchValue, setSearchValue] = useState('');
|
||||||
const [isPending, startTransition] = useTransition();
|
const [isPending, startTransition] = useTransition();
|
||||||
const menuItems = useRef([]);
|
const menuItems = useRef([]);
|
||||||
|
const { styles } = useStyles();
|
||||||
|
|
||||||
const changeMenu = (v: boolean) => {
|
const changeMenu = (v: boolean) => {
|
||||||
// 这里是为了防止当鼠标快速滑过时,终止菜单的渲染,防止卡顿
|
// 这里是为了防止当鼠标快速滑过时,终止菜单的渲染,防止卡顿
|
||||||
@ -155,6 +156,7 @@ SchemaInitializer.Button = observer(
|
|||||||
key: item.key || `item-group-${indexA}`,
|
key: item.key || `item-group-${indexA}`,
|
||||||
label,
|
label,
|
||||||
title: label,
|
title: label,
|
||||||
|
popupClassName: styles.nbMenuItemGroup,
|
||||||
children: renderItems(item.children),
|
children: renderItems(item.children),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { createStyles } from 'antd-style';
|
import { createStyles } from 'antd-style';
|
||||||
|
|
||||||
export const useStyles = createStyles(() => {
|
export const useStyles = createStyles(({ token }) => {
|
||||||
return {
|
return {
|
||||||
nbMenuItemGroup: {
|
nbMenuItemGroup: {
|
||||||
maxHeight: '50vh',
|
maxHeight: '50vh',
|
||||||
overflow: 'auto',
|
overflowY: 'auto',
|
||||||
|
boxShadow: token.boxShadowSecondary,
|
||||||
|
borderRadius: token.borderRadiusLG,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user