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

AgGrid auto_size_strategy failure only with rx.match #28

Open
bertbarabas opened this issue Oct 27, 2024 · 2 comments
Open

AgGrid auto_size_strategy failure only with rx.match #28

bertbarabas opened this issue Oct 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@bertbarabas
Copy link

In general auto_size_strategy={"type": "fitCellContents"} works, BUT if it is used in an rx.ag_grid that is under the control of rx.match, it no longer works properly.

The following are screen shots showing two ag_grids, the first ag_grid (Grid1) is under the control of an rx.match, the second (Grid3) is not.

The first screen shot is the initial rendering and both ag_grids work as expected.

The second screen shot shows the result of switching (using state and rx.match) the top grid from showing Grid1 to showing Grid2 and then back to showing Grid1 (while Grid3 remains the same)

image

As you can see the auto_size_strategy is only partially rendered in the top grid in the second screen shot below because column 3 and higher are all much wider than necessary.

image

I have also seen other issues when under rx.match such as the columns out of order which I assume is part of the same issue. It's almost as though the ag_grid is only partially rendered before being displayed under rx.match. In other tests I have noticed that if it is also under a tab, switching off the tab and back cause the rx.ag_grid that was rendered incorrectly to be re-rendered correctly after the rx.tab switch.

Here is the source code for the test case:

AgGrid auto_size_strategy failure.zip

Copy link

linear bot commented Oct 27, 2024

@bertbarabas
Copy link
Author

I swapped the rx.match out and replaced it with two rx.cond statements to achieve the same desired effect.

The bug does not happen if I use rx.cond so a work around is to stop using rx.match and to simply replace it with a series of rx.cond statements.

@Lendemor Lendemor added the bug Something isn't working label Nov 21, 2024
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
None yet
Development

No branches or pull requests

2 participants