Clipped SVG polygon receives mouse events -
here facts:
i have div rounded corners containing svg element rounded corners creates circle.
inside circle (svg) drawing 4 polygons make out different circle quadrants.
the polygons respond hover changing color - when user mouse on specific quadrant in circle - lights up.
the svg ,
div
containing svg both haveoverflow:hidden
css directive.when mouse on area outside circle (but inside clipped rectangle of polygon) - corresponding quadrant lights up...
why element responding mouse on though hovering on clipped area? how can make sure not happen? (without creating occluding transparent elements - want able touch in layer below...).
edit: added fiddle requested:
in fiddle - note surrounding div bordered red line. polygons (in blue) clipped red border (div), , when hover on polygon becomes lighter shade of blue. polygon highlights outside area of red circle border if on polygon.
edit:
as commented robert longson, there no problem @ in firefox. however, in chrome problem described, , in ie svg polygon not responding hover.
so question chrome remains - in chrome. how know if bug should report, or if designed behavioral difference?
try experimenting pointer-events attribute.
https://developer.mozilla.org/en-us/docs/web/svg/attribute/pointer-events
Comments
Post a Comment