Skip to content

Commit

Permalink
Remove event param from onBlur/onFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Jul 2, 2024
1 parent 9b00a2b commit 28b8660
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 9 additions & 6 deletions packages/react-resizable-panels/src/PanelResizeHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { assert } from "./utils/assert";
import {
createElement,
CSSProperties,
FocusEvent,
HTMLAttributes,
PropsWithChildren,
ReactElement,
Expand All @@ -30,14 +29,16 @@ export type ResizeHandlerState = "drag" | "hover" | "inactive";

export type PanelResizeHandleProps = Omit<
HTMLAttributes<keyof HTMLElementTagNameMap>,
"id"
"id" | "onBlur" | "onFocus"
> &
PropsWithChildren<{
className?: string;
disabled?: boolean;
hitAreaMargins?: PointerHitAreaMargins;
id?: string | null;
onBlur?: () => void;
onDragging?: PanelResizeHandleOnDragging;
onFocus?: () => void;
style?: CSSProperties;
tabIndex?: number;
tagName?: keyof HTMLElementTagNameMap;
Expand All @@ -49,7 +50,9 @@ export function PanelResizeHandle({
disabled = false,
hitAreaMargins,
id: idFromProps,
onBlur,
onDragging,
onFocus,
style: styleFromProps = {},
tabIndex = 0,
tagName: Type = "div",
Expand Down Expand Up @@ -208,13 +211,13 @@ export function PanelResizeHandle({
children,
className: classNameFromProps,
id: idFromProps,
onBlur: (event: FocusEvent<keyof HTMLElementTagNameMap>) => {
onBlur: () => {
setIsFocused(false);
rest?.onBlur?.(event);
onBlur?.();
},
onFocus: () => (event: FocusEvent<keyof HTMLElementTagNameMap>) => {
onFocus: () => {
setIsFocused(true);
rest?.onFocus?.(event);
onFocus?.();
},
ref: elementRef,
role: "separator",
Expand Down
2 changes: 0 additions & 2 deletions packages/react-resizable-panels/src/vendor/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as React from "react";
import type {
CSSProperties,
ElementType,
FocusEvent,
ForwardedRef,
HTMLAttributes,
MouseEvent,
Expand Down Expand Up @@ -61,7 +60,6 @@ export {
export type {
CSSProperties,
ElementType,
FocusEvent,
ForwardedRef,
HTMLAttributes,
MouseEvent,
Expand Down

0 comments on commit 28b8660

Please sign in to comment.