Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SVG image click event mystery

ANSWERED

I've made a repo here where you can see the code: https://github.com/outragedpinkracoon/dice_roller

 

My app displays some images of dice, and when you click them it shows the result. However, the click event only registers once on the dice, or in some parts of the image not at all.

 

Can you see where I have gone wrong?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

The "result" label seems to create a mask that extends above and to the right of the displayed text.

This area overlaps some of the dice and these cannot be clicked. This seems to be a bug.

 

If you move the result label between "dice_tray" and "d4, it will work.

 

View best answer in original post

Best Answer
3 REPLIES 3

The "result" label seems to create a mask that extends above and to the right of the displayed text.

This area overlaps some of the dice and these cannot be clicked. This seems to be a bug.

 

If you move the result label between "dice_tray" and "d4, it will work.

 

Best Answer

Thank you so much!

Best Answer
0 Votes

For reference, I had to move the 'result' text tag up before the listing of the 'image' tags.

Best Answer
0 Votes