Skip to content

Commit

Permalink
FontSizePicker: Change the storybook control type to inline-check
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Feb 26, 2025
1 parent a8b6ec5 commit 32086da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const meta: Meta< typeof FontSizePicker > = {
component: FontSizePicker,
argTypes: {
value: { control: false },
units: {
control: 'inline-check',
options: [ 'px', 'em', 'rem', 'vw', 'vh' ],
},
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/unit-control/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export function filterUnitsWithSettings(
// Although the `isArray` check shouldn't be necessary (given the signature of
// this typed function), it's better to stay on the side of caution, since
// this function may be called from un-typed environments.
return Array.isArray( availableUnits ) && Array.isArray( allowedUnitValues )
return Array.isArray( availableUnits )
? availableUnits.filter( ( unit ) =>
allowedUnitValues.includes( unit.value )
)
Expand Down

0 comments on commit 32086da

Please sign in to comment.