Skip to content

disabled attribute applied inappropriately. #3649

@seongminn

Description

@seongminn

Bug report

Current behavior

When applying the ₩disabled₩ attribute to elements used as buttons, such as XXX.Trigger or XXX.Close, both the disabled attribute and the data-disabled attribute are applied in the HTML.

These elements can be rendered as non-button elements using prop like render={<span />}. However, the disabled attribute remains in this case. According to the MDN documentation, the disabled attribute is not applied to span tags. Therefore, the aria-disabled attribute should be applied instead.

Expected behavior

  • When an element is rendered as a button tag, apply the data-disabled and disabled attributes.
  • When an element is rendered as a tag other than a button, apply the data-disabled and aria-disabled attributes.

Reproducible example

https://stackblitz.com/edit/kn1mbuqo?file=src%2FApp.tsx

Base UI version

1.0.0

Which browser are you using?

Chrome

Which OS are you using?

Mac OS

Which assistive tech are you using (if applicable)?

x

Additional context

x

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: all componentsWidespread work has an impact on almost all components.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions