FIO-9245 DataGrid: Fix width and positioning for table buttons #118
+8
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-9245
Description
What changed?
Removed
col-1
bootstrap class from the data grid table buttons, which takes 1/12 of the width of the grid row. In certain cases, when using Safari (and I think in certain cases when making the screen size smaller) the width of this button would expand dramatically and squash the other rows. I also removed the class from the data grid reorder button since the same problem could occur there. I also addeddisplay: block
andmargin: 0 auto
to the buttons to center them in their table cells for a more consistent layout.Why have you chosen this solution?
It seemed to me that a similar bootstrap class
col-md-1
(which also takes up 1/12 of the grid row, but is applied at a breakpoint of screens sized >= 768px) was added in the bootstrap3 data grid template here and then copy/pasted to the bootstrap4 template. It was later modified tocol-1
in bootstrap 4 here andcol-1
was added in bootstrap5. However, while fixing the problem in most cases, it was still broken in Safari; I'm guessing that Safari is calculating the parent grid container differently somehow, so that 1/12 of its width is massive compared to the other items.That change stemmed from this ticket https://formio.atlassian.net/browse/FIO-8303.
Here's a video demonstrating the fix in a few different environments (on Safari, with Form Manager, which uses bootstrap 4 still and on FVP). I was having trouble getting FVP to load in the @formio/bootstrap changes, so I apply them manually in the recording.
Screen.Recording.2024-12-09.at.12.00.12.PM.mov
Breaking Changes / Backwards Compatibility
Reverts 3dde49a#diff-d4f4129fd92b63c9446af2cf9a7d3d15b45cfbfc8b7adb61b131e5c8c1227bdf
Dependencies
n/a
How has this PR been tested?
Manually tested in the portal for Safari, Chrome, Firefox and Brave.
Checklist: