Skip to content

Commit

Permalink
Add the onfocus to the custom unit select unit control
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Nov 28, 2022
1 parent 2e34359 commit 9a49313
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/components/src/unit-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function UnforwardedUnitControl(
units: unitsProp = CSS_UNITS,
value: valueProp,
onBlur: onBlurProp,
onFocus: onFocusProp,
...props
} = unitControlProps;

Expand Down Expand Up @@ -244,6 +245,9 @@ function UnforwardedUnitControl(
unit={ unit }
units={ units }
onBlur={ onBlurProp }
onFocus={
onFocusProp as unknown as FocusEventHandler< HTMLSelectElement >
}
/>
) : null;

Expand All @@ -269,6 +273,7 @@ function UnforwardedUnitControl(
isPressEnterToChange={ isPressEnterToChange }
label={ label }
onBlur={ handleOnBlur }
onFocus={ onFocusProp }
onKeyDown={ handleOnKeyDown }
onChange={ handleOnQuantityChange }
ref={ forwardedRef }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function UnitSelectControl( {
className,
isUnitSelectTabbable: isTabbable = true,
onChange,
onFocus,
size = 'default',
unit = 'px',
units = CSS_UNITS,
Expand Down

0 comments on commit 9a49313

Please sign in to comment.