infragram icon indicating copy to clipboard operation
infragram copied to clipboard

Use of initMouseEvent is deprecated

Open Somya-Singhal opened this issue 2 years ago • 3 comments

In infragram.js, initMouseEvent is used, but as the use of initMouseEvent has been deprecated, so I can be fixed by the below modification

Here is the code snippet where the issue exists: event = document.createEvent("MouseEvents"); event.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); lnk.dispatchEvent(event);

Can be fixed by below modification: const mouseEvent = getMouseEvent(); lnk.dispatchEvent(mouseEvent("click", { screenX: 0, screenY: 0, clientX: 0, clientY: 0 }));

Somya-Singhal avatar Apr 04 '22 02:04 Somya-Singhal

@TildaDares , if my above solution is fine can I work on this issue? Please correct me if I am wrong! Or if it's fine I can also create it as an FTO template so that it could be assigned to someone else😊

Somya-Singhal avatar Apr 04 '22 02:04 Somya-Singhal

Hi @Somya-Singhal either way would be great, thank you!!

jywarren avatar Apr 05 '22 20:04 jywarren

Thanks @jywarren , for reviewing the issue. I have linked the PR #324 . Can you please review it and inform me if any changes are required?

Somya-Singhal avatar Apr 06 '22 00:04 Somya-Singhal