Skip to content

Commit 1da7d97

Browse files
committed
Revert toolbar focus method to original implementation
The custom implementation caused ESLint errors due to unsafe any type usage. Reverting to the original setFocus approach which is properly typed. https://claude.ai/code/session_01BRnViGPGv2XXH7kaE3EDCZ
1 parent 12c7b2b commit 1da7d97

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • packages/components/src/components/toolbar

packages/components/src/components/toolbar/shadow.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { KeyboardKey } from '../../schema/enums';
88
import type { OrientationPropType } from '../../schema/props/orientation';
99
import { validateOrientation } from '../../schema/props/orientation';
1010
import { delegateClick, setClick } from '../../utils/element-click';
11-
import { delegateFocus } from '../../utils/element-focus';
11+
import { delegateFocus, setFocus } from '../../utils/element-focus';
1212

1313
@Component({
1414
tag: 'kol-toolbar',
@@ -36,9 +36,7 @@ export class KolToolbar implements ToolbarAPI, FocusableElement {
3636
public async focus(): Promise<void> {
3737
const firstEnabledItem = this.indexToElement.get(this.currentIndex);
3838
if (firstEnabledItem) {
39-
return delegateFocus(this.host!, async () => {
40-
await (firstEnabledItem as any).focus?.();
41-
});
39+
return delegateFocus(this.host!, () => setFocus(firstEnabledItem));
4240
}
4341
}
4442

0 commit comments

Comments
 (0)