Skip to content

Commit ce17c29

Browse files
Type the anchor scroll opt-out as noscroll (solidjs/solid-router#605) (#3536)
* Type the anchor scroll opt-out as noscroll, matching its siblings and the router (solidjs/solid-router#605) The client-navigation contract on plain anchors is lowercase (link, state, replace, preload), as is every HTML attribute in these types; noScroll was the one camelCase outlier, so the spelling the router README documents and reads (hasAttribute("noscroll")) did not type-check. jsx.d.ts and the @solidjs/h copy follow jsx-h.d.ts (the jsx-sync source of truth). Co-authored-by: Cursor <[email protected]> * Undo the pre-commit prettier reformat; keep only the noscroll rename The hook ran a newer prettier than the repo's and rewrapped unrelated unions. Net change against next is the one line per file. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
1 parent 9a29b1a commit ce17c29

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@solidjs/web": patch
3+
"@solidjs/h": patch
4+
---
5+
6+
Type the anchor's scroll opt-out as `noscroll`, not `noScroll` (solidjs/solid-router#605). The client-navigation contract on plain `<a>` elements is spelled lowercase — `link`, `state`, `replace`, `preload` — like every other HTML attribute in these types (`novalidate`, `autofocus`, `crossorigin`), and the router documents and reads the lowercase form (`a.hasAttribute("noscroll")`); `noScroll` was the one camelCase outlier, so the spelling the router README shows was a type error. Runtime is unchanged: `setAttribute` and the HTML parser already lowercase the name, so existing `<a noScroll>` markup keeps working and only needs the spelling updated to type-check.

‎packages/h/jsx-runtime/src/jsx.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ export namespace JSX {
11261126
/** Serialized (JSON) history state pushed alongside the navigation. */
11271127
state?: FunctionMaybe<string | RemoveAttribute>;
11281128
/** Suppress scroll restoration/reset after the navigation. */
1129-
noScroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1129+
noscroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
11301130
/** Replace the current history entry instead of pushing a new one. */
11311131
replace?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
11321132
/** Route preload intent; `"false"` disables the integration's default eager preload. */

‎packages/web/jsx/jsx-h.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ export namespace JSX {
11271127
/** Serialized (JSON) history state pushed alongside the navigation. */
11281128
state?: FunctionMaybe<string | RemoveAttribute>;
11291129
/** Suppress scroll restoration/reset after the navigation. */
1130-
noScroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1130+
noscroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
11311131
/** Replace the current history entry instead of pushing a new one. */
11321132
replace?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
11331133
/** Route preload intent; `"false"` disables the integration's default eager preload. */

‎packages/web/jsx/jsx.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ export namespace JSX {
11381138
/** Serialized (JSON) history state pushed alongside the navigation. */
11391139
state?: string | RemoveAttribute;
11401140
/** Suppress scroll restoration/reset after the navigation. */
1141-
noScroll?: BooleanAttribute | RemoveAttribute;
1141+
noscroll?: BooleanAttribute | RemoveAttribute;
11421142
/** Replace the current history entry instead of pushing a new one. */
11431143
replace?: BooleanAttribute | RemoveAttribute;
11441144
/** Route preload intent; `"false"` disables the integration's default eager preload. */

0 commit comments

Comments
 (0)