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

[4.0] All backend lists use center-aligned fields #28904

Closed
nikosdion opened this issue May 2, 2020 · 18 comments
Closed

[4.0] All backend lists use center-aligned fields #28904

nikosdion opened this issue May 2, 2020 · 18 comments

Comments

@nikosdion
Copy link
Contributor

Steps to reproduce the issue

Open any backend list where it's critical that the user understands its nested structure such as Menus, User Groups or Categories

Expected result

The Title field is left aligned, giving an intuitive overview of the nested structure of the listed information.

Actual result

Everything is centre-aligned, making the structure not obvious to new users and a read headache for us experienced users.

System information (as much as possible)

Not relevant to this issue.

Additional comments

The Title field – the one and only field that's centre-aligned – is also the one that needs to be immediately scannable on a long list by the person using the site. Centre alignment makes it really hard to do that.

I tried to see if this is reported before but I could not find any open issue about this.

@brianteeman
Copy link
Contributor

Must be a very recent change that caused this

@nikosdion
Copy link
Contributor Author

Nope, this is actually as old as the file in the repository is. The title column is rendered everywhere as a <th> which is centre-aligned by Bootstrap. Centre-alignment of TH elements has been a thing in Bootstrap since at least Boostrap 2. This should really be a <td> which fixes the table structure and display.

@brianteeman
Copy link
Contributor

Are we talking about the same thing?

image

@brianteeman
Copy link
Contributor

This should really be a which fixes the table structure and display.

That would be incorrect for accessibility reasons and others because the title is the header for the row in a horizontal direction

@nikosdion
Copy link
Contributor Author

We are talking about the same thing. I am using the latest Joomla 4 development branch.

@nikosdion
Copy link
Contributor Author

This is what I see
image

@brianteeman
Copy link
Contributor

Don't know what to say @nikosdion I dont see that on the latest branch as of 5 minutes ago

@nikosdion
Copy link
Contributor Author

I can tell you why. I am using Safari. You are using Chrome or Firefox. The template.min.css defines text-align: inherit for <th> elements. Safari uses centred text for <th> elements. Other browsers use left aligned text. Here's the important thing. Safari is the ONLY rendering engine on iOS. So that is something that definitely needs fixing. It's not just me, it's everyone using Safari.

Can we please not be the victims of browser monoculture? We've tried that 20 years ago, it sucked.

@infograf768
Copy link
Member

I confirm this happens with Safari, not with Firefox (Macintosh)

@brianteeman
Copy link
Contributor

Can you tell me how the alignment is on this page

https://getbootstrap.com/docs/4.4/content/tables/

@infograf768
Copy link
Member

infograf768 commented May 2, 2020

when we have <th scope="col"> it is aligned left (in LTR)

@brianteeman
Copy link
Contributor

It seems that the problem is upstream in bootstrap with a recent change to their resets. They have acknowledged and fixed it. twbs/bootstrap#30323

@nikosdion
Copy link
Contributor Author

The content on https://getbootstrap.com/docs/4.4/content/tables/ looks correct:
image

As @infograf768 said, if we were to correctly use <th scope="col"> the alignment would also be correct. Reading https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th it says that if not specified it reverts to auto which as far as I can tell lets the browser decide. I guess Safari makes the wrong guess. Also note that the Bootstrap doc page you linked does use explicit scope. Joomla doesn't.

I guess we should really be adding scope to TH elements if they're outside a THEAD. A THEAD readily implies that its TH elements are scoped to the column but a TH in a TBODY row could be anything. If the reason for using TH instead of TD is accessibility we should be explicit and be sure instead of implicit and hope for the best. Right? This is a serious question; I am trying to improve accessibility on my own stuff as well.

@brianteeman
Copy link
Contributor

We are using th scope=col and th scope=col everywhere - or at least we should be as I added it. The only place I am aware of that I didnt already check was your webauthn plugin

image

As I stated it is a bug in bootstrap which they have fixed on their site but the fix hasnt been released yet.

@wilsonge do we need to manually apply that fix?

@nikosdion
Copy link
Contributor Author

@brianteeman I've never used a TH inside a TBODY by my own accord, so... 🤷

@brianteeman
Copy link
Contributor

Took me a while to get my head around it as well - but it is definitely correct

@nikosdion
Copy link
Contributor Author

Yeah, I thought I knew how tables work but I read the MDN page only today. I now understand the use case – and why scope is important when the TH is not inside a THEAD. Definitely noted for future reference and use.

brianteeman added a commit to brianteeman/joomla-cms that referenced this issue May 3, 2020
PR for joomla#28904

This is a test PR for the TH alignment issue with safari. It is a bug in bootstrap that they have fixed and merged but not released yet. See twbs/bootstrap#30323

This PR adds a _temporary_ reboot.css override with the code direct from bootstrap. I can't see any other way to fix this beta blocker.

I do not have access to Safari to test this.

@nikosdion please can you test this
infograf768 pushed a commit that referenced this issue May 4, 2020
* [4.0] th on safari

PR for #28904

This is a test PR for the TH alignment issue with safari. It is a bug in bootstrap that they have fixed and merged but not released yet. See twbs/bootstrap#30323

This PR adds a _temporary_ reboot.css override with the code direct from bootstrap. I can't see any other way to fix this beta blocker.

I do not have access to Safari to test this.

@nikosdion please can you test this

* Update _reboot.scss
@Quy Quy closed this as completed May 4, 2020
@Quy
Copy link
Contributor

Quy commented May 4, 2020

Fixed in PR #28921


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28904.

sakiss pushed a commit to sakiss/joomla-cms that referenced this issue Oct 16, 2020
* [4.0] th on safari

PR for joomla#28904

This is a test PR for the TH alignment issue with safari. It is a bug in bootstrap that they have fixed and merged but not released yet. See twbs/bootstrap#30323

This PR adds a _temporary_ reboot.css override with the code direct from bootstrap. I can't see any other way to fix this beta blocker.

I do not have access to Safari to test this.

@nikosdion please can you test this

* Update _reboot.scss
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

5 participants