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

<v-grid> text-overflow: ellipsis; doesn’t work for cell content #10

Closed
Saulis opened this issue May 20, 2015 · 6 comments
Closed

<v-grid> text-overflow: ellipsis; doesn’t work for cell content #10

Saulis opened this issue May 20, 2015 · 6 comments
Assignees
Milestone

Comments

@Saulis
Copy link
Contributor

Saulis commented May 20, 2015

Testing with tehapo/project-list-demo, sorting looks like this:

Chrome:
image

Firefox:
image

Safari:
image

I guess using ... would be OK way to go with all browsers.

@Saulis Saulis changed the title Sort indicator is placed on top of header content <v-grid> Sort indicator is placed on top of header content May 20, 2015
@Saulis Saulis modified the milestone: 0.3.0 May 20, 2015
@jouni
Copy link
Member

jouni commented May 21, 2015

It seems that combining display: inline-flex; and text-overflow: ellipsis; doesn’t work correctly in other browsers than Safari. Setting .v-grid-cell { display: inline-block; } adds the ellipsis also on Chrome and Firefox when the column is narrow enough.

@jouni
Copy link
Member

jouni commented May 21, 2015

Also, this affects all body cells as well, none of them have the ellipsis either when the cell content is wider than the cell.

It might be that we need to reconsider display: inline-flex on the cells…

@jouni
Copy link
Member

jouni commented May 21, 2015

Related issue in Chrome: https://code.google.com/p/chromium/issues/detail?id=327437
Related issue in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=912434

It seems this will not be fixed by the browsers. Safari just happens to do what we would like.

Options:

  • Change .v-grid-cell back to display: inline-block; and handle vertical centering differently.
  • Add an extra element inside the cells, which will allow us to move the text-overflow: ellipsis; to that element. This would also make custom renderers work more like expected, if we continue to use display: inline-flex; for the cells.

@jouni jouni changed the title <v-grid> Sort indicator is placed on top of header content <v-grid> text-overflow: ellipsis; doesn’t work for cell content May 26, 2015
@jouni
Copy link
Member

jouni commented May 26, 2015

This affects body cells as well as header and footer cells.

@jouni jouni modified the milestone: 0.3.0 Jun 9, 2015
@jouni jouni modified the milestones: 0.3.0, “Next” Jun 18, 2015
@anezthes
Copy link

One possible solution would be to remove the inline height of the header cells, and only set that for the header row. We can also let the header row vertically align the cells.

// Allow for ellipsis.
.v-grid-cell.v-grid {
  display: inline-block;
}

// Move height and background to parent.
.v-grid-header.v-grid th.v-grid {
  background-color: transparent; // <--- can also be removed if we remove the white bg color from .v-grid-cell.v-grid.
  height: auto !important; // <--- can be removed if we remove inline height.
}

// Header rows.
.v-grid-header > .v-grid-row {
  align-items: center;
  background-color: #03A9F4;

  display: flex;

  height: 32px;
}

@jouni
Copy link
Member

jouni commented Jun 26, 2015

One idea I had was that we have default renderer implementations for all cells that wrap the texts in a <span> which has the text-overflow: ellipsis;.

If we have position: relative; overflow: hidden; on the cells, that means no-one can use a custom renderer which has some elements that need to be visible outside the grid cell (e.g. custom drop down menus). We might be able to avoid position: relative;, though. We need to try this out.

tomivirkki added a commit that referenced this issue Jun 29, 2015
Change-Id: I10ebfb9b19cc3146cccc553646b91e959ceac0c9
@Saulis Saulis modified the milestones: Next, 0.3.0-beta4 Jul 3, 2015
HJK181 pushed a commit to CommerceExperts/vaadin-grid that referenced this issue Jul 27, 2020
HJK181 pushed a commit to CommerceExperts/vaadin-grid that referenced this issue Jul 27, 2020
Enabled selecting an item from a static list (fixes vaadin#10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants