Commit 92039de
### Summary
This PR fixes issue #6756 where clicking the '#' anchor next to headings
did not copy the section link to the clipboard.
### Changes
- Updated `HeaderWrapperExtension` to add an inline `onclick` handler
for the heading anchor `<a>` elements.
- Clicking '#' now:
- Copies the full URL including fragment to the clipboard
- Updates the URL in the address bar
- Prevents default page jump behavior
- Temporarily replaces '#' with a smaller 'Copied!' text for 1.2 seconds
to provide visual feedback
### Testing
- Verified that clicking '#' on h2–h5 headings copies the correct URL
- Confirmed that the page URL updates without scrolling
- Works across multiple headings on the same page
### Notes
- This approach adds behavior directly in the anchor element.
- Alternative approach would be a global client-side handler, but this
is safe and consistent with current Jaspr HTML generation.
Fixes #6756
reference video:
https://github.com/user-attachments/assets/06411e8d-07c2-4057-a20e-ace125897a16
---------
Co-authored-by: Parker Lougheed <parlough@gmail.com>
Co-authored-by: Connie Ooi <connieooi@google.com>
1 parent ef861b8 commit 92039de
1 file changed
+52
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
27 | 79 | | |
28 | 80 | | |
29 | 81 | | |
| |||
0 commit comments