observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

"load" event never fires for SVG element #617

Closed borango closed 1 month ago

borango commented 4 months ago

I have a test SVG diagram with 4 event handlers (click, mouseenter, load and DOMContentLoaded), all attached in the same way.

Events for click and mouseenter are fired and presented successfully in the status cell.

However, I never see a trace of a load event.

Since the handlers are attached to a SVGSVGElement, I expect it to fire the load-related events also.

Please see the reproducer:

https://observablehq.com/@bogo/load-event-never-fires

I see the same behaviour when I export this notebook's code and run it locally, which eliminates the iframe and sandbox.

Expected behavior

I expect to read the load text in the status cell just after this notebook has fully loaded and the diagram is visible (DOMContentLoaded would be just as nice).

Desktop (please complete the following information):

mootari commented 1 month ago

The load event is specified for external resources but your example inlines the SVG.

If you still seek support for this issue I recommend to create a post in our forum or Slack, since since the Feedback repository is primarily intended for platform feedback.