Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAC] Disabled DatePicker stops Tab focus moving forward when used inside Modal & Dialog #7321

Open
joonass-visma opened this issue Nov 5, 2024 · 1 comment

Comments

@joonass-visma
Copy link

Provide a general summary of the issue here

When having disabled DatePicker inside Modal Dialog with some focusable elements before and after it (e.g. TextFields) and you start Tabbing through the fields with keyboard, the focus won't move past the DatePicker.

🤔 Expected Behavior?

Keyboard focus should jump over the disabled DatePicker and continue normally to next focusable element.

😯 Current Behavior

Keyboard focus gets stuck to last focusable element before disabled DatePicker.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

Try adding to DatePicker with isDisabled=true after the "Last name" TextField in this example: https://react-spectrum.adobe.com/react-aria/Modal.html#example

Version

react-aria-components v1.4.1

What browsers are you seeing the problem on?

Firefox, Chrome

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@nwidynski
Copy link

nwidynski commented Nov 6, 2024

@joonass-visma Can confirm this issue. As an intermediary solution, set the onKeyDown property of the last focusable element before the disabled date picker (e.g. the textfield) to an empty function.

@snowystinger We need to set tabIndex to -1 on all button props when disabled here.

spinButtonProps: {
role: 'spinbutton',
'aria-valuenow': value !== undefined && !isNaN(value) ? value : undefined,
'aria-valuetext': ariaTextValue,
'aria-valuemin': minValue,
'aria-valuemax': maxValue,
'aria-disabled': isDisabled || undefined,
'aria-readonly': isReadOnly || undefined,
'aria-required': isRequired || undefined,
onKeyDown,
onFocus,
onBlur
},

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

No branches or pull requests

2 participants