I have this problem where css color property doesn't work when used along side with pointer-events property in Safari OSX and iOS, whenever DOM gets updated.
Consider these simple codes below:
HTML:
<div class="test">
Click Me!
</div>
<div class="ux-capacity-variant v-normal-bottom v-normal-right disabled" >
<div class="show-for-medium-up section-header text-center capacity">128GB</div>
</div>
<div class="ux-capacity-variant v-normal-bottom v-normal-right " >
<div class="show-for-medium-up section-header text-center capacity">258GB</div>
</div>
<div class="ux-capacity-variant v-normal-bottom v-normal-right " >
<div class="show-for-medium-up section-header text-center capacity">512GB</div>
</div>
Javascript (jQuery):
$(document).ready(function(){
$('.test').click(function() {
$('.ux-capacity-variant').toggleClass('disabled');
});
});
CSS:
.ux-capacity-variant.disabled {
cursor: default;
pointer-events: none;
color: grey
}
.ux-capacity-variant{
color: red
}
Codepen code also available here: https://codepen.io/ardnet5/pen/ZEKLXvM
Open that in Safari OSX and iOS, also on Chrome iOS, and click "Click Me!" to demonstrate.
In Safari browser, the css color property is NOT applied correctly - when use along with pointer-events property, whenever DOM gets updated (via Javascript event).
We see the correct color in Computed css in Safari dev tools. Still the wrong color show up on the screen (it supposed to shown red color on NON .disabled class, but instead it's STILL showing grey).
Btw, this is working in Chrome, and other browsers, in other OS (ie: Win).
Is there any workaround to make css color property work? or is this genuine bug in Safari?
Thanks in advance!