Skip to content

(Re)introduce <svelte:document>? #3310

@danburzo

Description

@danburzo

Is your feature request related to a problem? Please describe.

I noticed Svelte used to have a <svelte:document> but then it got removed. However, listeners on document work a bit differently than on document.body. For example, a mousemove / mouseup event on document.body stops the minute you move the cursor out of the browser viewport, but on document they keep getting fired.

Describe the solution you'd like

A <svelte:document> element to work with events on the Document object (especially events that happen exclusively on a document).

Describe alternatives you've considered

You can add events to document imperatively, but a declarative alternative would be nicer.

How important is this feature to you?

I've just started exploring Svelte, so I've not tried many things in it. For my particular usecase I would not be able to use <svelte:document> but, for the sake of completeness, I think it would be a good addition.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions