atapas / webapis-playground

The Web APIs Playground is a project to showcase the JavaScript Web APIs with examples and demonstrations. Client-side JavaScript APIs are here to help with providing wrapper functions for many low-level tasks.

Home Page:https://webapis-playground.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› [Bug]: Canvas API - Multiple event listeners added by clicking on Show canvases button

rnsharma10 opened this issue Β· comments

commented

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
commented

pls assign this to me.