webapis-playground icon indicating copy to clipboard operation
webapis-playground copied to clipboard

🐛 [Bug]: Canvas API - Multiple event listeners added by clicking on Show canvases button

Open rnsharma10 opened this issue 2 years ago • 1 comments

Describe the bug Canvas Api bug -

  • Clicking on Show Canvases button creates duplicate event listners.
  • The code written on Show Canvases does not remove the event listners already created, and adds another ones which will result in same events applied multiple times and crashing the page.

To Reproduce Steps to reproduce the behavior:

  1. Go to Canvas API page
  2. And check event listner available on drawing canvas element image
  3. Now click on Show Canvases button once and check event listners on drawing canvas element. image
  4. Clicking on same button 5 more times. image

Expected behavior Clicking on Show button multiple times should not create unnecessary more event listeners.

Desktop

  • OS: Windows 10
  • Browser Chrome
  • Version 106

rnsharma10 avatar Oct 13 '22 19:10 rnsharma10

pls assign this to me.

rnsharma10 avatar Oct 14 '22 14:10 rnsharma10