Commit fc412d1
fix(view-mode-switch): drop data-toggle="buttons" to stop Bootstrap null-deref on /search
The search view-mode switch rendered <div class="btn-group" data-toggle="buttons">
with <button routerLink> children and no <input>. On window.load, the bundled
Bootstrap 4 JS runs its load.bs.button.data-api handler, which iterates
[data-toggle="buttons"] .btn and reads .checked on
querySelector('input:not([type="hidden"])'); with no input it dereferences null
and throws an uncaught pageerror ("can't access property 'checked', s is null"),
failing the Playwright consoleErrors test on /search.
The attribute is semantically wrong here (there are no toggle inputs) and inert in
stock ng-bootstrap DSpace; routerLinkActive/[class.active] already drive the active
state, so the list/grid/detail toggle is unchanged visually and functionally.
Fixes dataquest-dev/dspace-customers#931
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 2437ed2 commit fc412d1
1 file changed
Lines changed: 1 addition & 1 deletion
File tree
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments