fix(pages): reserve the reg- prefix for the sign-up form's field ids
A block named reg-email would have duplicated the form's input id, so its label and #reg-email links would bind to the wrong element. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
This commit is contained in:
1 parent
93acebf162
commit
92e62fb3fd
13 files changed
+25
-20
No files matched your search
@@ -24,7 +24,7 @@ Marketing wants a button near the top of a landing page to jump to the sign-up f
|
||||
|
||||
## Design
|
||||
|
||||
- **Link name.** Each block has an optional "Link name": lowercase letters, digits and `-`, starting with a letter or digit, at most 40 characters, unique on the page. services-counter checks it. The public page renders it as the block's `id`.
|
||||
- **Link name.** Each block has an optional "Link name": lowercase letters, digits and `-`, starting with a letter or digit and not with `reg-` (the sign-up form's field ids), at most 40 characters, unique on the page. services-counter checks it. The public page renders it as the block's `id`.
|
||||
- **`#name` links.** Button links and rich-text links also accept `#` followed by a name of that pattern. The same rule is in services-counter, the portal's `isSafeLink`, the rich-text editor and the public sanitiser.
|
||||
- **Frame bridge.** The frame document's injected script, which already reports its height, also catches clicks on `#name` links inside the frame and posts the name and, when the frame holds an element with that `id`, the element's offset. The page acts on such a message only from its own frame and only for a name of the pattern. It scrolls to the frame's top plus that offset when the frame has the target; otherwise to a block on the page with that link name; otherwise it does nothing. The frame link's default action is prevented, so the frame never navigates.
|
||||
|
||||
|
||||
Reference in new issue
Block a user