diff --git a/js/utils/helper.ts b/js/utils/helper.ts index 1bce9457d5..1111f6cfad 100644 --- a/js/utils/helper.ts +++ b/js/utils/helper.ts @@ -257,3 +257,8 @@ export function calculateNodeSize(targetElement: HTMLElement) { sizingStyle, }; } + +export function isSafari(): boolean { + const ua = window?.navigator?.userAgent; + return /Safari/.test(ua) && !/Chrome/.test(ua); +} diff --git a/style/web/_global.less b/style/web/_global.less index ff194fece2..a47a971458 100644 --- a/style/web/_global.less +++ b/style/web/_global.less @@ -31,6 +31,20 @@ } } +// Safari 兼容方案: 使用 transform 而非 d 动画 +// Safari 不支持对 path 的 d 属性进行动画 +.@{prefix}-fake-arrow.@{prefix}-fake-arrow--transform { + path { + transition: transform @anim-duration-base; + transform-origin: center; + } + &.@{prefix}-fake-arrow--active { + path { + transform: scaleY(-1); + } + } +} + .@{prefix}-slide-down-enter-active, .@{prefix}-slide-down-leave-active { transition: