Skip to content

fix(BBBCheckbox)!: apply ariaLabel to the input element - #96

Open
Arthurk12 wants to merge 1 commit into
bigbluebutton:developfrom
Arthurk12:issue/88-but-for-checkbox
Open

Arthurk12 wants to merge 1 commit into
bigbluebutton:developfrom
Arthurk12:issue/88-but-for-checkbox

Conversation

@Arthurk12

Copy link
Copy Markdown
Member

What does this PR do?

Analogus of #95 for the BBBCheckbox

The aria-label prop is passed to the MUI Checkbox root, which forwards it to the ButtonBase span instead of the , so a BBBCheckbox without a visible label has no accessible name. dataTest and the consumer's inputProps reach the , but through inputProps, which is deprecated in MUI and removed in v7.

Pass aria-label and data-test through slotProps.input so they land on the , merging any slotProps.input supplied by the consumer (object or function form).

MUI does not merge inputProps and slotProps.input (a slotProps.input replaces inputProps entirely), so a consumer's inputProps would be silently dropped; remove it from CheckboxProps instead, turning that into a compile error. Keeping a library-owned inputProps and forwarding it to slotProps.input was discarded to avoid maintaining a second API for the same purpose.

BREAKING CHANGE: BBBCheckbox no longer accepts inputProps; use slotProps.input to set attributes on the underlying .

Closes Issue(s)

Closes none

The aria-label prop is passed to the MUI Checkbox root, which forwards
it to the ButtonBase span instead of the <input>, so a BBBCheckbox
without a visible label has no accessible name. dataTest and the
consumer's inputProps reach the <input>, but through inputProps, which
is deprecated in MUI and removed in v7.

Pass aria-label and data-test through slotProps.input so they land on
the <input>, merging any slotProps.input supplied by the consumer
(object or function form).

MUI does not merge inputProps and slotProps.input (a slotProps.input
replaces inputProps entirely), so a consumer's inputProps would be
silently dropped; remove it from CheckboxProps instead, turning that
into a compile error. Keeping a library-owned inputProps and
forwarding it to slotProps.input was discarded to avoid maintaining a
second API for the same purpose.

BREAKING CHANGE: BBBCheckbox no longer accepts inputProps; use
slotProps.input to set attributes on the underlying <input>.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant