From 8a7b494cdf86b9822247718f7665389c06015bf0 Mon Sep 17 00:00:00 2001 From: Chamara Abesinghe Date: Tue, 5 Dec 2023 12:59:30 +0530 Subject: [PATCH 1/2] TEC-265: Prevent focus first on table headers --- components/src/directives/focus-first-element/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/src/directives/focus-first-element/index.ts b/components/src/directives/focus-first-element/index.ts index 8b130211e..ae0caaa03 100644 --- a/components/src/directives/focus-first-element/index.ts +++ b/components/src/directives/focus-first-element/index.ts @@ -7,7 +7,7 @@ export interface FocusFirstHTMLElement extends HTMLElement { const focusableElements = 'input:not([disabled]), select, textarea, [tabindex], [href]'; const excludeElements = - 'button:not(.oxd-dialog-close-button,.modal-reset-button,[disabled])'; + 'button:not(.oxd-dialog-close-button,.modal-reset-button,[disabled]), i:not(.oxd-table-header-sort-icon)'; const firstFocusedElementsOnMounted = new Map(); const firstFocusedElementsOnUpdated = new Map(); let previosFocusedElement: Element | null; From 980ae68e601a7e907007784f4eeccf008a54d965 Mon Sep 17 00:00:00 2001 From: Chamara Abesinghe Date: Tue, 5 Dec 2023 18:29:04 +0530 Subject: [PATCH 2/2] TEC-265: Stop focus first directive from focusing on table columns --- components/src/directives/focus-first-element/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/src/directives/focus-first-element/index.ts b/components/src/directives/focus-first-element/index.ts index ae0caaa03..cb68d37bc 100644 --- a/components/src/directives/focus-first-element/index.ts +++ b/components/src/directives/focus-first-element/index.ts @@ -5,9 +5,9 @@ export interface FocusFirstHTMLElement extends HTMLElement { } const focusableElements = - 'input:not([disabled]), select, textarea, [tabindex], [href]'; + 'input:not([disabled]), select, textarea, [tabindex]:not(.oxd-table-header-sort-icon), [href]'; const excludeElements = - 'button:not(.oxd-dialog-close-button,.modal-reset-button,[disabled]), i:not(.oxd-table-header-sort-icon)'; + 'button:not(.oxd-dialog-close-button,.modal-reset-button,[disabled])'; const firstFocusedElementsOnMounted = new Map(); const firstFocusedElementsOnUpdated = new Map(); let previosFocusedElement: Element | null;