Skip to content

Commit 60b22ab

Browse files
fix: falsy attachments types (#15939)
1 parent a5a0b49 commit 60b22ab

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/chilled-otters-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: falsy attachments types

packages/svelte/elements.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ export interface HTMLAttributes<T extends EventTarget> extends AriaAttributes, D
863863
// allow any data- attribute
864864
[key: `data-${string}`]: any;
865865

866-
// allow any attachment
867-
[key: symbol]: Attachment<T>;
866+
// allow any attachment and falsy values (by using false we prevent the usage of booleans values by themselves)
867+
[key: symbol]: Attachment<T> | false | undefined | null;
868868
}
869869

870870
export type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});

0 commit comments

Comments
 (0)