Skip to content

[RAC] isDisabled on ToggleButtonGroup not applied to children #7798

@lucaas

Description

@lucaas

Provide a general summary of the issue here

According to the documentation, setting isDisabled on ToggleButtonGroup should set it for all child ToggleButton:s. When testing, this doesn't seem the case.

Example:

        <ToggleButtonGroup isDisabled>
          <ToggleButton>Toggle button 1</ToggleButton>
          <ToggleButton>Toggle button 2</ToggleButton>
        </ToggleButtonGroup>

Renders the buttons as enabled.

🤔 Expected Behavior?

ToggleButton:s should be disabled when ToggleButtonGroup is

😯 Current Behavior

Sandbox @ https://codesandbox.io/p/sandbox/busy-mahavira-vhxxg7?file=%2Fsrc%2FApp.js%3A16%2C5

The disabled toggle buttons have a red color, and do not show the pink outline when hovered. I expect all three groups to be in this state.

💁 Possible Solution

No response

🔦 Context

Worked around the issue by using a ToggleButtonContext.Provider, but did not expect this to be needed.

🖥️ Steps to Reproduce

Sandbox: https://codesandbox.io/p/sandbox/react-aria-components-template-g7wmmk

The disabled toggle buttons have a red color, and do not show the pink outline when hovered. I expect all three groups to be in this state.

Version

react-aria-components@1.6.0

What browsers are you seeing the problem on?

Safari

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions