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

Empty grids shouldn't take any space #3650

Closed
avernet opened this issue Jul 6, 2018 · 5 comments
Closed

Empty grids shouldn't take any space #3650

avernet opened this issue Jul 6, 2018 · 5 comments

Comments

@avernet
Copy link
Collaborator

avernet commented Jul 6, 2018

Empty rows don't take space (#2414), but it seems empty grids do take space.

+1 from customer

@avernet
Copy link
Collaborator Author

avernet commented Jul 6, 2018

Is this a regression? I'm wondering as this seems to be covered by the title of #2414 which mentions the grids themselves in addition to grid rows. The space is created by a margin-bottom: 10px on .xbl-fr-grid, and somehow, while the grid is "empty", the margin collapsing doesn't happen. However, it does happen when manually removing the table.fr-grid inside the div.xbl-fr-grid.

@ebruchez
Copy link
Collaborator

ebruchez commented Jul 6, 2018

I don't know if it's a regression or not.

@ebruchez ebruchez added this to To Do in Orbeon Forms 2018.1 Jul 6, 2018
@avernet
Copy link
Collaborator Author

avernet commented Jul 6, 2018

I'd expect margin collapsing to kick in, but it doesn't when the blocks contain a table. I must be missing something here. I suspect there is a very simple explanation (and hopefully a simple workaround as well), so I asked the question on Stack Overflow.

@avernet
Copy link
Collaborator Author

avernet commented Jul 10, 2018

The table creates a block formatting context, so each table is in a different block formatting context. Now it seems that this also causes each container div to be a in different block formatting context, and margin collapsing only happens amongst blocks that are part of the same block formatting context.

I haven't found a way to prevent the table from creating a block formatting context, so instead, I removed the margin on the grid, and added a padding on sections (except the first), so we have some space between the last grid in a section and the next section. This isn't exactly the same as before, as now we don't have the 10px between grids, but it can be argued that is is better in some (most?) cases, in particular when consecutive grids aren't logical units but instead used to align controls.

Orbeon Forms 2018.1 automation moved this from To Do to Done Jul 10, 2018
@avernet
Copy link
Collaborator Author

avernet commented Oct 25, 2018

To reproduce the issue, paste the source of form.txt in Form Builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants