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

Misalignment Column header separators with actual column separators in high resolution display #6799

Closed
banajit opened this issue Jul 10, 2018 · 5 comments

Comments

@banajit
Copy link

banajit commented Jul 10, 2018

It has been noticed that, in high resolution display, column headers separator are not aligned with actual data column separator. The issue exist in the ui-grid example itself.

http://ui-grid.info/docs/#!/tutorial/321_singleFilter

Also screenshot attached.
Tested monitor resolution: 1920x1080

Please let me know if there is any workaround exist.
misalign headers

@m4m4m4
Copy link
Contributor

m4m4m4 commented Jul 25, 2018

This also occurs on windows if the display DPI setting is set on anything but 100%
It also happens if you zoom to a odd percentage

The issue is that the header display property is table based and the content is block based.

Here is a simple css fix that changes the header to be flexbox based instead:

/* UI-Grid header non-alignment fix */
.ui-grid-header-cell-wrapper {
    display:flex;
    width:100%;
}
.ui-grid-header-cell-row {
    display: flex; 
    flex-direction: row;
    flex-wrap: wrap;
}
.ui-grid-header-cell {
    display:block;
}
/* Fixes IE word-wrap if needed on header cells */
.ui-grid-header-cell > div {
    flex-basis:100%;
}

And here is a plunker with all features enabled with the fix
http://plnkr.co/edit/04D1vmJRROXkKGfxNZfU?p=preview

I changed the less file in the source code and no tests seem to fail. I however know that flexbox has some odd behaviour in IE and Safari. This will also probably break every custom template out there.
Let me know if this is the direction you want to take and i'll submit it as a pull request @mportuga

@mportuga
Copy link
Member

@m4m4m4 At the moment, the only IE versions that we support are 10 and 11, so if you can make it work for those, be it via media queries or something else, then I think that would be a great solution. And for worse case scenario, I am willing to sacrifice IE10 support, although I rather not drop that one just yet.

@m4m4m4
Copy link
Contributor

m4m4m4 commented Jul 27, 2018

Looks like it is working as it should on IE10 if I add the vendor prefix "-ms", will make a pull request now

mportuga pushed a commit that referenced this issue Jul 27, 2018
* Change grid header css to flexbox

Change grid header css to be flexbox based

Header display properties was previously table based while body is block based. This causes alignment issues in some cases.

* Better spacing

* Another space

Fix #6799, Fix #2592
@banajit
Copy link
Author

banajit commented Aug 7, 2018

Thank you so much for the fix, this works.

defields923 pushed a commit to defields923/ui-grid that referenced this issue Oct 30, 2018
* Change grid header css to flexbox

Change grid header css to be flexbox based

Header display properties was previously table based while body is block based. This causes alignment issues in some cases.

* Better spacing

* Another space

Fix angular-ui#6799, Fix angular-ui#2592
@kevin4760
Copy link

Awesome fix! Thank you!

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

No branches or pull requests

4 participants