fix: Dropdown sub-menu missing motion (#39235)

* chore: fix dropdown motion miss

* fix: dropdown missing motion & site check
This commit is contained in:
二货爱吃白萝卜 2022-12-04 13:22:57 +08:00 committed by GitHub
parent 3d9046d079
commit fe60528e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -30,20 +30,20 @@ export default function InfoNewVersion() {
p.style.position = 'fixed';
p.style.pointerEvents = 'none';
p.style.visibility = 'hidden';
p.style.opacity = '0';
p.style.width = '0';
document.body.appendChild(p);
updateCSS(
`
:where(.${whereCls}) {
opacity: 0.3 !important;
width: 93px !important;
}
`,
whereCls,
);
// Check style
const { opacity } = getComputedStyle(p);
setSupportWhere(String(opacity) === '0.3');
const { width } = getComputedStyle(p);
setSupportWhere(String(width) === '93px');
return () => {
document.body.removeChild(p);

View File

@ -2,6 +2,7 @@ import { getArrowOffset } from '../../style/placementArrow';
import {
initMoveMotion,
initSlideMotion,
initZoomMotion,
slideDownIn,
slideDownOut,
slideUpIn,
@ -418,6 +419,7 @@ const genBaseStyle: GenerateStyle<DropdownToken> = (token) => {
initSlideMotion(token, 'slide-down'),
initMoveMotion(token, 'move-up'),
initMoveMotion(token, 'move-down'),
initZoomMotion(token, 'zoom-big'),
],
];
};