-
Notifications
You must be signed in to change notification settings - Fork 113
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
Table mode: columns resizing due to flex display #421
Comments
Thanks for reporting. Can you give an example that demonstrates the issue? |
Here is a quick video, you can see as I scroll down the table the columns widths are resizing based on the view. Its not the best video to demo the issue but I think it gets the point across. This can make it difficult to follow the table if each column is shortening/expanding as you review the data. Screen.Recording.2024-03-28.at.12.27.43.PM.mov |
Thanks. How can I reproduce this? Can you share a JSON document? |
of course test.json |
Thanks. What's going on here is the following: table mode only renders the visible rows of the table. When the max width of the visible items in a column changes, the width of the column changes. Some thoughts on how to improve this:
Any other ideas? Help improving this would be welcome. |
😂 I think you're right. And this is one of my annoyances with Excel: after opening a file you first have to manually adjust the widths of the columns. I hope with Opening with a default width and allowing to change the width is an option indeed. Maybe set the initial width based on the initially visible items. That would be a good guess in most cases. And then the editor should not change it automatically when scrolling. We could create a button "Fit" to resize all columns again to fit the currently visible contents or something like that. Ideally, such a button should be only visible when some of the columns actually need to be resized. |
Agree with your comments. I think it also depends on the user's window/monitor size. If the size is too small the current setting will probably be very difficult. I believe most people who use jsoneditor in table mode are reviewing/revising lots of data, a "Fit" button to resize would be great for a "pro" user who can take advantage if it is a hotkey. It depends who you want to serve here, the pro user or the average one who is likely not aware of all the cool features. |
I can't promise I'll be able to help, but I'll take a look if you think a button to switch is the way to go |
Thanks! My thoughts right now: A solution that doesn't require a manual action still has my preference, though I'm not sure whehter that will work out. So first I would like to experiment a bit to see whether my idea of a smooth transition or adjusting the horizontal scroll could work (idea 1 and 2 here). If those experiments are no success, the second best option is to initially auto fit and lock the widths, and create a button to call fit and lock again. Does that make sense? |
Sure let me know if I can help you test anything 👍 |
During table mode, I've noticed if the amount of data in a column varies a lot in size, the table columns will resize as you scroll up/down making it difficult to follow the table and contents.
I've hacked this with
.jse-modal-contents{ display: block !important; }
which works, but it causes an error in development:I would appreciate any pointers to best resolve this!
The text was updated successfully, but these errors were encountered: