Skip to content

Commit fc412d1

Browse files
Matus Kasakclaude
andcommitted
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

src/app/shared/view-mode-switch/view-mode-switch.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="btn-group" data-toggle="buttons">
1+
<div class="btn-group">
22
<button *ngIf="isToShow(viewModeEnum.ListElement)"
33
[attr.aria-current]="currentMode === viewModeEnum.ListElement"
44
[attr.aria-label]="'search.view-switch.show-list' | translate"

0 commit comments

Comments
 (0)