react-spectrum
012642d1 - fix(actiongroup,tabs): keep ArrowLeft/Right consistent in RTL vertical orientation (#10467)

Commit
6 days ago
fix(actiongroup,tabs): keep ArrowLeft/Right consistent in RTL vertical orientation (#10467) * fix(actiongroup,tabs): keep ArrowLeft/Right consistent in RTL vertical orientation ArrowLeft/ArrowRight are flipped in RTL locales, but the flip was gated on orientation === 'horizontal'. In a vertical ActionGroup or TabList in an RTL locale the flip was skipped entirely, so ArrowRight moved focus to the next item and ArrowLeft to the previous one -- the opposite of the horizontal RTL pairings, and inconsistent with the rest of the arrow key handling. Drop the orientation check so ArrowLeft always moves to the next item and ArrowRight to the previous one in RTL, regardless of orientation. ArrowUp/ArrowDown never consult this flag, so vertical up/down navigation is unchanged. useToolbar has a similar-looking condition that is correct as written: it only handles ArrowLeft/Right when horizontal, so its orientation check is what stops ArrowDown from being flipped in RTL. * move tests and expand coverage * fix lint --------- Co-authored-by: Rob Snow <rsnow@adobe.com>
Author
Parents
Loading