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 [isPending, startTransition] = useTransition();
|
||||
const menuItems = useRef([]);
|
||||
const { styles } = useStyles();
|
||||
|
||||
const changeMenu = (v: boolean) => {
|
||||
// 这里是为了防止当鼠标快速滑过时,终止菜单的渲染,防止卡顿
|
||||
@ -155,6 +156,7 @@ SchemaInitializer.Button = observer(
|
||||
key: item.key || `item-group-${indexA}`,
|
||||
label,
|
||||
title: label,
|
||||
popupClassName: styles.nbMenuItemGroup,
|
||||
children: renderItems(item.children),
|
||||
}
|
||||
);
|
||||
|
@ -1,10 +1,12 @@
|
||||
import { createStyles } from 'antd-style';
|
||||
|
||||
export const useStyles = createStyles(() => {
|
||||
export const useStyles = createStyles(({ token }) => {
|
||||
return {
|
||||
nbMenuItemGroup: {
|
||||
maxHeight: '50vh',
|
||||
overflow: 'auto',
|
||||
overflowY: 'auto',
|
||||
boxShadow: token.boxShadowSecondary,
|
||||
borderRadius: token.borderRadiusLG,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user