On an iOS device in Safari, tapping this SVG element does not trigger the transition animation to fade in the replacement
<g id="training-sub-menu">
. The animation is confirmed to work, as there is a strange behavior where long-pressing where the links should be opens an iOS context menu that then fades in the <g>
with a 2-second transition. It seems that the animation does not get triggered, unlike other browsers that respond to :hover
.
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 306.12 409.2">
<defs>
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600');
.font-md {
font-family: 'Poppins';
font-size: 10px;
font-weight: 500;
}
:root {
--yellow: #f6b034;
}
.training {
fill: var(--yellow);
}
.sub-menu {
opacity: 0;
visibility: hidden;
height: 0;
}
.sub-menu > g {
opacity: 0;
-webkit-transition: opacity 2s ease-in-out;
}
.has-dropdown:hover + .sub-menu,
.has-dropdown:hover + .sub-menu > g {
opacity: 1;
visibility: visible;
height: auto;
pointer-events: visiblePainted;
transform: unset;
}
.has-dropdown:hover {
opacity: 0;
visibility: hidden;
height: 0;
}
.sub-menu:hover {
opacity: 1;
visibility: visible;
height: auto;
pointer-events: none;
}
.sub-menu:hover > g {
opacity: 1;
}
</style>
</defs>
<g id="training" class="has-dropdown">
<path class="training" d="m0,256c0-27.61,22.39-50,50-50,27.61,0,50,22.38,50,49.99,0-.21.02-.42.02-.63v29.39c0,11.06,8.45,20.15,19.25,21.15.02,0,.04.09,0,.09-.04,0-62.38,0-69.27,0,0,0,0,0,0,0s0,0,0,0h-.62c.1,0,.21,0,.31,0C22.22,305.82,0,283.51,0,256Z"/>
<text class="font-md" transform="translate(31 285)">Training</text>
</g>
<g id="training-sub-menu" class="sub-menu">
<path class="training" d="m0,256c0-27.61,22.39-50,50-50,27.61,0,50,22.38,50,49.99,0-.21.02-.42.02-.63v29.39c0,11.06,8.45,20.15,19.25,21.15.02,0,.04.09,0,.09-.04,0-62.38,0-69.27,0,0,0,0,0,0,0s0,0,0,0h-.62c.1,0,.21,0,.31,0C22.22,305.82,0,283.51,0,256Z"/>
<g id="text">
<text class="font-md sub-menu-item" transform="translate(31 285)">
<a href="https://google.com" target="_parent">Google</a>
</text>
<text class="font-md sub-menu-item" transform="translate(31 265)">
<a href="https://google.com" target="_parent">Google</a>
</text>
<text class="font-md sub-menu-item" transform="translate(31 245)">
<a href="https://google.com" target="_parent">Google</a>
</text>
</g>
</g>
</svg>
Efforts to apply the transition using <g>
elements and -webkit-transition
have been unsuccessful. Additionally, using onclick
as suggested on the page has not resolved the issue either. Could the problem be related to the absence of a clickable element as mentioned on this page?