Skip to content

Commit 91299b3

Browse files
authored
fix: stronger types for the autocomplete attribute (#13201)
1 parent 36137e0 commit 91299b3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/curvy-foxes-wink.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+
feat: better types for the `autocomplete` attribute

packages/svelte/elements.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ export interface HTMLFieldsetAttributes extends HTMLAttributes<HTMLFieldSetEleme
937937
export interface HTMLFormAttributes extends HTMLAttributes<HTMLFormElement> {
938938
acceptcharset?: string | undefined | null;
939939
action?: string | undefined | null;
940-
autocomplete?: string | undefined | null;
940+
autocomplete?: AutoFillBase | undefined | null;
941941
enctype?: string | undefined | null;
942942
method?: string | undefined | null;
943943
name?: string | undefined | null;
@@ -1025,7 +1025,7 @@ export type HTMLInputTypeAttribute =
10251025
export interface HTMLInputAttributes extends HTMLAttributes<HTMLInputElement> {
10261026
accept?: string | undefined | null;
10271027
alt?: string | undefined | null;
1028-
autocomplete?: string | undefined | null;
1028+
autocomplete?: AutoFill | undefined | null;
10291029
capture?: boolean | 'user' | 'environment' | undefined | null; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
10301030
checked?: boolean | undefined | null;
10311031
dirname?: string | undefined | null;
@@ -1244,7 +1244,7 @@ export interface HTMLScriptAttributes extends HTMLAttributes<HTMLScriptElement>
12441244
}
12451245

12461246
export interface HTMLSelectAttributes extends HTMLAttributes<HTMLSelectElement> {
1247-
autocomplete?: string | undefined | null;
1247+
autocomplete?: AutoFill | undefined | null;
12481248
disabled?: boolean | undefined | null;
12491249
form?: string | undefined | null;
12501250
multiple?: boolean | undefined | null;
@@ -1289,7 +1289,7 @@ export interface HTMLTableAttributes extends HTMLAttributes<HTMLTableElement> {
12891289
}
12901290

12911291
export interface HTMLTextareaAttributes extends HTMLAttributes<HTMLTextAreaElement> {
1292-
autocomplete?: string | undefined | null;
1292+
autocomplete?: AutoFill | undefined | null;
12931293
cols?: number | undefined | null;
12941294
dirname?: string | undefined | null;
12951295
disabled?: boolean | undefined | null;

0 commit comments

Comments
 (0)