Correct data-selector for global project select and skip disabled elements when searching for the first focusable element

pull/10930/head
Henriette Darge 2 years ago
parent f7b5b350e9
commit 016d5bdba5
  1. 2
      frontend/src/app/shared/components/project-list/project-list.component.html
  2. 1
      frontend/src/app/shared/components/project-list/project-list.component.ts
  3. 3
      frontend/src/app/shared/components/searchable-project-list/searchable-project-list.service.ts

@ -52,7 +52,7 @@
[ngClass]="{ 'spot-list--item-action_disabled': project.disabled }"
[title]="project.name"
[href]="extendedProjectUrl(project.id)"
[attr.data-list-action-selector]="projectListActionIdentifier"
[attr.data-list-selector]="projectListActionIdentifier"
>
<span
class="op-project-list--item-title spot-list--item-title"

@ -57,6 +57,7 @@ export class OpProjectListComponent {
};
projectListActionIdentifier = projectListActionIdentifier;
projectListItemIdentifier = projectListItemIdentifier;
constructor(

@ -15,7 +15,6 @@ import { KeyCodes } from 'core-app/shared/helpers/keyCodes.enum';
import {
projectListActionSelector,
projectListItemDisabled,
projectListItemSelector,
projectListRootSelector,
} from 'core-app/shared/components/project-list/project-list.component';
@ -92,7 +91,7 @@ export class SearchableProjectListService {
// If we're moving down, select first
if (!upwards) {
const first = document.querySelector<HTMLElement>(projectListActionSelector);
const first = document.querySelector<HTMLElement>(`${projectListActionSelector}:not(${projectListItemDisabled})`);
first?.focus();
}
}

Loading…
Cancel
Save