Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add content-visibility: auto state change event #14373

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kind-horses-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

add content-visibility auto state change event
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions packages/svelte/elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export type AnimationEventHandler<T extends EventTarget> = EventHandler<Animatio
export type TransitionEventHandler<T extends EventTarget> = EventHandler<TransitionEvent, T>;
export type MessageEventHandler<T extends EventTarget> = EventHandler<MessageEvent, T>;
export type ToggleEventHandler<T extends EventTarget> = EventHandler<ToggleEvent, T>;
export type ContentVisibilityAutoStateChangeEventHandler<T extends EventTarget> = EventHandler<
ContentVisibilityAutoStateChangeEvent,
T
>;

export type FullAutoFill =
| AutoFill
Expand Down Expand Up @@ -157,6 +161,20 @@ export interface DOMAttributes<T extends EventTarget> {
ontoggle?: ToggleEventHandler<T> | undefined | null;
ontogglecapture?: ToggleEventHandler<T> | undefined | null;

// Content visibility Events
'on:contentvisibilityautostatechange'?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;
oncontentvisibilityautostatechange?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;
oncontentvisibilityautostatechangecapture?:
| ContentVisibilityAutoStateChangeEventHandler<T>
| undefined
| null;

// Keyboard Events
'on:keydown'?: KeyboardEventHandler<T> | undefined | null;
onkeydown?: KeyboardEventHandler<T> | undefined | null;
Expand Down
Loading