Skip to content

[EuiTableCell] Default table cell alignment in Safari is mixed #4568

Closed

Description

@ryankeairns

In elastic/kibana#92374 , it was noted that the table cell content alignment is inconsistent on Safari. Using the align prop works for right and center, as that applies an explicit class, but left and start appear to have no effect (i.e. they are left to the browser default, I suspect).

In effect, this means you cannot reliably for a left/start alignment on Safari. The likely code in question is below:

.euiTableCellContent {
overflow: hidden; /* 4 */
display: flex;
align-items: center; /* 1 */
padding: $euiTableCellContentPadding; /* 2 */
}
.euiTableCellContent__text {
@include euiTextBreakWord; /* 4 */
min-width: 0;
text-overflow: ellipsis;
}
.euiTableCellContent--alignRight {
justify-content: flex-end;
text-align: right;
}
.euiTableCellContent--alignCenter {
justify-content: center;
text-align: center;
}

Screenshot from Safari

Screen Shot 2021-02-23 at 12 01 48 PM

Activity

  1. added
    ⚠️ needs validation
    on Feb 23, 2021
  2. cchaos commented on Mar 19, 2021

    @cchaos
    Contributor

    Can we get a copy/paste of the actual implementation code, or at lease the rendered cell DOM? I feel like this may be specific to the inner child.

  3. changed the title [-]Default table cell alignment in Safari is mixed[/-] [+][EuiTableCell] Default table cell alignment in Safari is mixed[/+] on Mar 19, 2021
  4. ryankeairns commented on Mar 22, 2021

    @ryankeairns
    ContributorAuthor

    The linked PR provides more context. There are some interesting details in there.

  5. cchaos commented on Mar 22, 2021

    @cchaos
    Contributor

    In that PR it looks like the root of problem was tracked to the specific content:

    The problem appeared when the link was wrapped with additional <div>, which comes from RedirectAppLinks component.

  6. ryankeairns commented on Mar 22, 2021

    @ryankeairns
    ContributorAuthor

    I tinkered with the markup, briefly, and it didn't seem to be the culprit. Also, the first example in the EUI docs site shows the same result on Safari:

    Screen Shot 2021-03-22 at 8 33 59 AM

  7. cchaos commented on Mar 22, 2021

    @cchaos
    Contributor

    👍 Ugh, just another place where Safari is way too heavy-handed with their default browser styles.

  8. github-actions commented on Sep 18, 2021

    @github-actions

    👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

  9. added
    stale-issue
    on Sep 18, 2021
  10. self-assigned this
    on Sep 18, 2021
  11. removed
    stale-issue
    on Sep 18, 2021
  12. cchaos commented on Sep 18, 2021

    @cchaos
    Contributor

    I'll try to tackle this fix as part of the new Emotion global styles.

  13. cchaos commented on Oct 18, 2021

    @cchaos
    Contributor

    I found that the root of the problem was when we converted the first column from rendering a <td> to a <th> to make it a row header.

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

Metadata

Metadata

Assignees

Labels

⚠️ needs validation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions