Skip to content

Commit

Permalink
fix(Focusable): add ref prop, fix event types
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jun 16, 2022
1 parent b5d9265 commit f1e20cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/deck-components/Focusable.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { HTMLAttributes, ReactNode, VFC } from "react";
import { HTMLAttributes, ReactNode, RefAttributes, VFC } from "react";
import { findModuleChild } from "../webpack";

export interface FocusableProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
"flow-children"?: string;
focusClassName?: string;
focusWithinClassName?: string;
onActivate?: () => void;
onCancel?: () => void;
onActivate?: (e: CustomEvent) => void;
onCancel?: (e: CustomEvent) => void;
}

export const Focusable = findModuleChild((m) => {
Expand All @@ -16,4 +16,4 @@ export const Focusable = findModuleChild((m) => {
if (m[prop]?.render?.toString()?.includes('["flow-children","onActivate","onCancel","focusClassName",'))
return m[prop];
}
}) as VFC<FocusableProps>;
}) as VFC<FocusableProps & RefAttributes<HTMLDivElement>>;

0 comments on commit f1e20cd

Please sign in to comment.