fix: incorrectly :active background (#607)

This commit is contained in:
Dunqing 2022-07-11 18:19:57 +08:00 committed by GitHub
parent ef0d60b683
commit 45bcfe241c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -349,7 +349,17 @@ Menu.Item = observer((props) => {
const field = useField(); const field = useField();
const Designer = useContext(MenuItemDesignerContext); const Designer = useContext(MenuItemDesignerContext);
return ( return (
<AntdMenu.Item {...others} key={schema.name} eventKey={schema.name} schema={schema}> <AntdMenu.Item
{...others}
className={css`
:active {
background: inherit;
}
`}
key={schema.name}
eventKey={schema.name}
schema={schema}
>
<SortableItem className={designerCss}> <SortableItem className={designerCss}>
<Icon type={icon} /> <Icon type={icon} />
<span <span
@ -377,6 +387,11 @@ Menu.URL = observer((props) => {
return ( return (
<AntdMenu.Item <AntdMenu.Item
{...others} {...others}
className={css`
:active {
background: inherit;
}
`}
key={schema.name} key={schema.name}
eventKey={schema.name} eventKey={schema.name}
schema={schema} schema={schema}
@ -415,6 +430,11 @@ Menu.SubMenu = observer((props) => {
return ( return (
<AntdMenu.SubMenu <AntdMenu.SubMenu
{...others} {...others}
className={css`
:active {
background: inherit;
}
`}
key={schema.name} key={schema.name}
eventKey={schema.name} eventKey={schema.name}
title={ title={