New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[material-ui][Chip] The skipFocusWhenDisabled
prop skips the focus when set to false and when disabled is true
#40096
Comments
skipFocusWhenDisabled
prop skips the focus when set to false and when disabled is true
@danilo-leal i want to work on this issue, can you please assign this to ? |
@aman44444 Assigned. Please let us know if you are facing any issues. |
@brijeshb42 i attempted to change the value of tabIndex both directly and indirectly, but it's not working. after debugging, i discovered that the value only changes when 'disabled' is applied. there is no effect of 'skipFocusWhenDisabled,' and i am sorry I couldn't determine how 'disabled' is changing the value. also sorry for the late reply. |
There's a bug in the |
Hey @ZeeshanTamboli, I want to take on this task but I'm a little confused. Accessibility wise, shouldn't a disabled Chip always have a tabIndex of -1? That is how it is in the ButtonBase component which imo is correct. I have removed the usage of this prop in my playground and it works as expected, the Chip is not focused, I did this to recreate the issue/PR you have sent. I feel like I'm missing an important piece. |
@aacevski When the <Chip label="Chip Filled" onDelete={() => {}} disabled /> Considering the issues with its implementation, and ideal solution is to consider removing this prop and address #35038 properly, which the PR #35065 attempts to resolve. It's worth noting that such a change would introduce a breaking change. |
Okay thank you @ZeeshanTamboli, I'll try to take on this and update you soon. 馃檶馃徏 |
Duplicates
Latest version
Steps to reproduce 馃暪
Link to live example:
Steps:
<Chip label="Clickable" disabled skipFocusWhenDisabled={false} onClick={handleClick} /> <Chip label="Clickable" variant="outlined" onClick={handleClick} />
Current behavior 馃槸
If you inspect the first chip component that is disabled if you set skipFocusWhenDisabled={true} the tabIndex is set to -1 which I think is correct if you then set skipFocusWhenDisabled={false} the tabIndex is still -1 which I think is incorrect.
Expected behavior 馃
When disabled is set to true and skipFocusWhenDisabled={false} the Index should not be -1 it should allow it to have focus.
Context 馃敠
No response
Your environment 馃寧
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: