Skip to content

Commit c886e4f

Browse files
authored
web: Fix issue where clicking a list item scrolls container. (goauthentik#16174)
1 parent f91ebc2 commit c886e4f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

web/src/elements/ak-list-select/ak-list-select.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,17 @@ export class ListSelect extends AKElement implements IListSelect {
154154
return elementCount === 0 ? -1 : checkIndex();
155155
}
156156

157+
/**
158+
* Highlight the currently focused item.
159+
*
160+
* @todo
161+
* This doesn't quite work as intended, but this component will likely
162+
* be refined after the PatternFly upgrade.
163+
*/
157164
private highlightFocusedItem() {
158165
this.displayedElements.forEach((item) => {
159166
item.classList.remove("ak-highlight-item");
160167
item.removeAttribute("aria-selected");
161-
item.tabIndex = -1;
162168
});
163169
const currentElement = this.currentElement;
164170
if (!currentElement) {
@@ -168,7 +174,6 @@ export class ListSelect extends AKElement implements IListSelect {
168174
// This is currently a radio emulation; "selected" is true here.
169175
// If this were a checkbox emulation (i.e. multi), "checked" would be appropriate.
170176
currentElement.setAttribute("aria-selected", "true");
171-
currentElement.scrollIntoView({ block: "center", behavior: "smooth" });
172177
}
173178

174179
@bound

0 commit comments

Comments
 (0)