Closed bradennapier closed 7 years ago
interesting @bradennapier - do you have simple code example so I can reproduce it?
I also got this for certain toggles, though I haven't been able to isolate why. It seems to happen specifically in Chrome; Firefox and Edge show fine. The fix also works when applied via JS:
const toggleFixStyle = {
WebkitMaskImage: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)'
};
...
<div>
<Toggle /> {/* masking messed up */}
<Toggle style={toggleFixStyle} /> {/* masking fixed */}
</div>
All right, it has to do with adjacent elements that have -webkit-backface-visibility: hidden
. Here's a simple test case:
<div>
<Toggle />
<div style={{ WebkitBackfaceVisibility: 'hidden' }} />
</div>
The toggle should have bugged masking. Removing -webkit-backface-visibility: hidden
via the inspector fixes it.
Probably just a Chrome bug we'll have to deal with.
@rchanou are you still using it? does the bug still exist?
I don't know, I removed the offending -webkit-backface-visibility: hidden
a while ago. Unless @bradennapier wants to chime in, I would say go ahead and close this because it appears to be a Chrome issue (which may be fixed by now), it's a rare case, and there's a documented workaround.
There is a bug with the toggle that when certain elements become rendered on the screen, the masking becomes messed up.
This style is required to resolve the issue:
When this is added via inspector, it resolves the problem: