Skip to content

Commit

Permalink
RadioGroup: Fix arrow key navigation in RTL (WordPress#66202)
Browse files Browse the repository at this point in the history
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 99eae66 commit 4f405ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- `Tabs`: fix indicator animation ([#66198](https://github.com/WordPress/gutenberg/pull/66198)).
- `ColorPalette`: prevent overflow of custom color button background ([#66152](https://github.com/WordPress/gutenberg/pull/66152)).
- `RadioGroup`: Fix arrow key navigation in RTL ([#66202](https://github.com/WordPress/gutenberg/pull/66202)).
- `Tabs` and `TabPanel`: Fix arrow key navigation in RTL ([#66201](https://github.com/WordPress/gutenberg/pull/66201)).

### Enhancements
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/radio-group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as Ariakit from '@ariakit/react';
* WordPress dependencies
*/
import { useMemo, forwardRef } from '@wordpress/element';
import { isRTL } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -34,6 +35,7 @@ function UnforwardedRadioGroup(
setValue: ( newValue ) => {
onChange?.( newValue ?? undefined );
},
rtl: isRTL(),
} );

const contextValue = useMemo(
Expand Down

0 comments on commit 4f405ac

Please sign in to comment.