Skip to content

Commit 500f8ce

Browse files
author
Jonny Muir
committed
refactor: rename #setInitialFocus to #setInitialFocusable and remove unnecessary calls
1 parent c663dc5 commit 500f8ce

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/uui-tabs/lib/uui-tab-group.element.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ export class UUITabGroupElement extends LitElement {
7575
this.removeEventListener('keydown', this.#onKeyDown);
7676
}
7777

78-
firstUpdated() {
79-
this.#setInitialFocus();
80-
}
81-
8278
#setFocusable(tab: UUITabElement | null, focus: boolean = true) {
8379
if (tab) {
8480
// Reset tabindex for all tabs
@@ -180,7 +176,7 @@ export class UUITabGroupElement extends LitElement {
180176
this.#tabResizeObservers.push(observer);
181177
});
182178

183-
this.#setInitialFocus();
179+
this.#setInitialFocusable();
184180
}
185181

186182
#onTabClicked = (e: MouseEvent) => {
@@ -368,7 +364,7 @@ export class UUITabGroupElement extends LitElement {
368364
);
369365
}
370366

371-
#setInitialFocus(): void {
367+
#setInitialFocusable(): void {
372368
// Set initial focus on the active, none hidden tab or the first tab
373369
let initialTab: UUITabElement | undefined;
374370

@@ -387,11 +383,12 @@ export class UUITabGroupElement extends LitElement {
387383

388384
render() {
389385
return html`
390-
<div id="main" @focus=${this.#setInitialFocus}>
386+
<div id="main">
391387
<div id="grid" role="tablist">
392388
<slot @slotchange=${this.#onSlotChange}></slot>
393389
</div>
394390
<uui-button
391+
aria-hidden="true"
395392
popovertarget="popover-container"
396393
style="display: none"
397394
id="more-button"
@@ -403,6 +400,7 @@ export class UUITabGroupElement extends LitElement {
403400
</div>
404401
<uui-popover-container
405402
id="popover-container"
403+
aria-hidden="true"
406404
popover
407405
placement="bottom-end">
408406
<div id="hidden-tabs-container" tabindex="-1">

0 commit comments

Comments
 (0)