website icon indicating copy to clipboard operation
website copied to clipboard

Consider being more precise in terms of what the `orientation` prop does (ie. no visual changes).

Open petegriffith opened this issue 2 years ago • 2 comments

Bug report

Current Behavior

The orientation prop has no effect on ToggleGroup. No matter what, the ToggleGroup has a horizontal orientation.

Expected behavior

Similar to the Slider, orientation ought to change the ToggleGroup's orientation; otherwise it should be removed as an option

Reproducible example

Note The following link comes directly from the ToggleGroup docs. I am also seeing this issue when running locally.

CodeSandbox Template

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-toggle-group 1.0.0
React n/a 18.0.0
Browser Chrome 105.0.5195.52
Assistive tech
Node n/a 16.15.0
npm/yarn pnpm 6.32.13
Operating System macOS Monterey 12.5.1 

petegriffith avatar Sep 01 '22 05:09 petegriffith

since radix is a style-free library, the orientation prop won't change the visual orientation but will change the functional orientation. in the case of ToggleGroup, vertical orientation will mean up/down arrow keys move focus within the component which appears to be working fine: https://codesandbox.io/s/awesome-edison-kyfiwr?file=/App.js

is there something else you are expecting here?

@benoitgrelard @andy-hook i wonder if it would be handy to update the docs surrounding this prop because the current docs aren't very clear here:

CleanShot 2022-09-01 at 10 54 53

jjenzz avatar Sep 01 '22 10:09 jjenzz

Yeah, @jjenzz is correct. I will rename and transfer this issue to the website repo instead for us to follow up on.

benoitgrelard avatar Sep 01 '22 11:09 benoitgrelard

Could the same be done for the Radio component?

Ademsk1 avatar Oct 30 '23 14:10 Ademsk1