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] App freezes when mounting disabled table rows after selection #7586

Open
levrik opened this issue Jan 9, 2025 · 1 comment
Open

[RAC] App freezes when mounting disabled table rows after selection #7586

levrik opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@levrik
Copy link

levrik commented Jan 9, 2025

Provide a general summary of the issue here

The app freezes completely when swapping table rows by disabled ones with different key.

🤔 Expected Behavior?

The app should not freeze.

😯 Current Behavior

The app freezes.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/fervent-architecture-6g96p6

  1. Select 1 or more rows
    • You must not select the 1st row only
    • Ensure the blue focus outline appears on the row (it sometimes does not in Chromium-based browsers likely due to the iframe, native :focus has same issues)
  2. Click "Toggle" button to swap out rows
  3. App freezes

Remove isDisabled from all loading rows in code and try again. It does not freeze anymore.

React.Aria.Table.Row.Freeze.mp4

Version

1.5.0

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@levrik levrik changed the title [RAC] App freezes when mounting disabled table rows under certain conditions [RAC] App freezes when mounting disabled table rows after selection Jan 9, 2025
@LFDanLu
Copy link
Member

LFDanLu commented Jan 10, 2025

Thanks for catching this, took a little bit but it seems like the root of this issue is with how we try to find a new row to focus if the previously focused row doesn't exist anymore. Since every row is disabled in the new set of items this portion of the code keeps looping. Off the top of my head, we can probably break out of it by simply flagging when it hits the else a second time but it might be worthwhile adding a function to SelectionManager/Collection that informs us if every item in the collection has been disabled via applying isDisabled to each Row/Item

@LFDanLu LFDanLu added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🩺 To Triage
Development

No branches or pull requests

2 participants