Skip to content

Using TableView at 90% zoom level triggers a re-render loop and errors #5357

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

Closed
JasonKaz opened this issue Nov 3, 2023 · 4 comments · Fixed by #6451
Closed

Using TableView at 90% zoom level triggers a re-render loop and errors #5357

JasonKaz opened this issue Nov 3, 2023 · 4 comments · Fixed by #6451
Labels
bug Something isn't working needs investigation

Comments

@JasonKaz
Copy link

JasonKaz commented Nov 3, 2023

Provide a general summary of the issue here

This issue may be 2 different errors, see here.

Original issue here:
When using the TableView component without a height it can sometimes cause a re-render loop which React catches and throws an error.
You can see this behavior in this example: https://codesandbox.io/s/react-spectrum-table-react-error-185-hx7vsw?file=/src/App.js

In that example it is erroring upon filter but we have many reports of customers not even being able to render the table at all. It must be some combination of data within the table, browser, and window size because we cannot replicate the error being thrown in that case.

The CodeSandbox is a typical use case for us using TableViews. We do not set a height or maxHeight because we want the tables to expand and contract depending on the row count and height. Setting a maxHeight would work for us, but we have confirmed that maxHeight alone does not prevent this error from being thrown.

🤔 Expected Behavior?

The table does not throw an error when height or maxHeight are missing.

😯 Current Behavior

It throws an error and crashes the application, or throws an error in an Error Boundary if one is used.

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

💁 Possible Solution

Applying a height to the TableView fixes it, but in doing so degrades our user experience.

🔦 Context

No response

🖥️ Steps to Reproduce

Reproduction steps are listed in the following: https://codesandbox.io/s/react-spectrum-table-react-error-185-hx7vsw?file=/src/App.js

Version

3.31.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?

OSX

🧢 Your Company/Team

Adobe/Admin Console

🕷 Tracking Issue

No response

@LFDanLu LFDanLu added bug Something isn't working needs investigation labels Nov 3, 2023
@github-project-automation github-project-automation bot moved this to ✏️ To Groom in RSP Component Milestones Nov 3, 2023
@yihuiliao yihuiliao mentioned this issue Nov 8, 2023
5 tasks
@JasonKaz JasonKaz changed the title TableView without a height causes a re-render loop and crashes the application Using TableView at 90% zoom level triggers a re-render loop and errors Nov 8, 2023
@LFDanLu
Copy link
Member

LFDanLu commented Nov 8, 2023

Some notes from digging:

EDIT: Second issue specifically introduced with the changes made in this file

@JasonKaz
Copy link
Author

JasonKaz commented Nov 9, 2023

Thanks @LFDanLu for noting the difference in errors.

I have finally been able to reproduce the error on initial load of the table which is the first issue you noted. I can confirm that bringing that change in does fix the issue locally for me.

@LFDanLu LFDanLu moved this from ✏️ To Groom to ✅ Done in RSP Component Milestones Nov 29, 2023
@bmingles
Copy link

bmingles commented Jan 12, 2024

We are experiencing this issue as well when TableView has min-height: 0; flex: 1 and is inside of a flex column container. Specifically inside of ActionBarContainer, these styles get automatically applied to the TableView child. For our use case, a workaround seems to be to set UNSAFE_style={{ display: 'grid' }} on the ActionBarContainer

@LFDanLu
Copy link
Member

LFDanLu commented Jan 12, 2024

@bmingles Does your ActionBarContainer have a static height or a variable height?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants