mirror of
https://github.com/apache/superset.git
synced 2026-05-21 15:55:10 +00:00
fix(DashboardBuilder): replace any types in shouldFocusTabs signature
Tighten the container contains() and event.target types to use EventTarget and Node-based types instead of any, so shouldFocusTabs has a fully typed signature.
This commit is contained in:
@@ -31,10 +31,10 @@ export const getRootLevelTabsComponent = (dashboardLayout: DashboardLayout) => {
|
||||
};
|
||||
|
||||
export const shouldFocusTabs = (
|
||||
event: { target: { className: string } },
|
||||
container: { contains: (arg0: any) => any } | null,
|
||||
event: { target: EventTarget & { className: string } },
|
||||
container: Pick<Node, 'contains'> | null,
|
||||
_menuRef: HTMLDivElement | null,
|
||||
): boolean =>
|
||||
// don't focus the tabs when we click on a tab
|
||||
event.target.className === 'ant-tabs-nav-wrap' ||
|
||||
(container?.contains(event.target) ?? false);
|
||||
(container?.contains(event.target as Node) ?? false);
|
||||
|
||||
Reference in New Issue
Block a user