Commit 9727024
fix: preserve <details> open state across htmx swaps
When ignoring or restoring items (packages/maintainers), htmx replaces
the suggestion element, causing all <details> sections to revert to
their default collapsed state. This is disruptive when working through
multiple ignored items in a row.
Add a small script that listens to htmx:beforeSwap to record which
<details> elements (by ID) are currently open, then restores the open
attribute on matching elements after htmx:afterSwap completes.
Fixes #913
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 4db1eda commit 9727024
1 file changed
Lines changed: 20 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
125 | 145 | | |
126 | 146 | | |
0 commit comments