Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Conversation

@Marc-Andre-Rivet
Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Sep 5, 2019

Fixes #188

Requires a dash-docs usage update: https://github.com/plotly/dash-docs/pull/642

Up to now it was necessary to do:

    style_data={'whiteSpace': 'normal'},
    css=[{
        'selector': '.dash-cell div.dash-cell-value',
        'rule': 'display: inline; white-space: inherit; overflow: inherit; text-overflow: inherit;'
    }],

in order to allow multiline & ellipsis.

With this change, it is possible to do it with only:

    style_data={
        'height': 'auto',
        'whiteSpace': 'normal'
    },

It's also now possible to set white-space, overflow and text-overflow in style_** and have it applied (inherited) by the cell's content without extra css.

Alongside being simpler, it also fixes old/weird alignment issues we've been seeing in the documentation for a long time now:

Before
image

After
image

At some point, it might be interesting to know which css properties can safely be inherited by default by div.dash-cell-value and update https://github.com/plotly/dash-table/blob/188-multiline/src/dash-table/components/Table/Table.less#L367 with all those values.

See follow up: #574

- remove unused styling code
- update changelog
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 5, 2019 19:41 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 5, 2019 19:42 Inactive
return typeof dimension === 'string' &&
/^\d+(\.\d+)?(px|em|rem|%)$/.test(dimension);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stumbled upon this code. It isn't used anymore. Removing.

@Marc-Andre-Rivet Marc-Andre-Rivet marked this pull request as ready for review September 5, 2019 20:18
@alexcjohnson
Copy link
Collaborator

Simpler is nice, but the remaining percy diffs look problematic and in the matching docs PR I don't see ellipsis https://dash-docs-pr-642.herokuapp.com/datatable/sizing

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 6, 2019 16:26 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 6, 2019 16:45 Inactive
@Marc-Andre-Rivet
Copy link
Contributor Author

Marc-Andre-Rivet commented Sep 6, 2019

@alexcjohnson Sorry about that. I promoted this to ready for review when it really wasn't. There's additional tweaking required.

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 6, 2019 17:23 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 6, 2019 20:41 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 10, 2019 20:37 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 10, 2019 20:59 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 10, 2019 22:19 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 10, 2019 22:58 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 13, 2019 16:24 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 13, 2019 16:53 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 13, 2019 17:40 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 13, 2019 19:09 Inactive
@Marc-Andre-Rivet
Copy link
Contributor Author

@alexcjohnson I think this is ready for another round

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-573 September 13, 2019 20:04 Inactive
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💃

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit a4ea856 into master Sep 13, 2019
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 188-multiline branch September 13, 2019 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A simpler interface for multi-line cells and ellipses?

4 participants