Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Firefox doesn't allow as much height for cells, leading to overflow #663

Closed
wbrgss opened this issue Dec 12, 2019 · 3 comments · Fixed by #665
Closed

Firefox doesn't allow as much height for cells, leading to overflow #663

wbrgss opened this issue Dec 12, 2019 · 3 comments · Fixed by #665
Assignees

Comments

@wbrgss
Copy link
Contributor

wbrgss commented Dec 12, 2019

In my version of Firefox, a dropdown within a cell with a new value selected (i.e. not on initial render) will overflow its cell container. The bottom grey border is overlapped:

Firefox:
dropdown-overflow

Chrome
dropdown-overflow-chrome

@wbrgss
Copy link
Contributor Author

wbrgss commented Dec 12, 2019

App used for the above gifs (taken from the docs)

expand app
import dash
import dash_html_components as html

import dash_table
import pandas as pd
from collections import OrderedDict

app = dash.Dash(__name__)

df = pd.DataFrame(OrderedDict([
    ('climate', ['Sunny', 'Snowy', 'Sunny', 'Rainy']),
    ('temperature', [13, 43, 50, 30]),
    ('city', ['NYC', 'Montreal', 'Miami', 'NYC'])
]))

app.layout = html.Div([
    dash_table.DataTable(
        id='table-dropdown',
        data=df.to_dict('records'),
        columns=[
            {'id': 'climate', 'name': 'climate', 'presentation': 'dropdown'},
            {'id': 'temperature', 'name': 'temperature'},
            {'id': 'city', 'name': 'city', 'presentation': 'dropdown'},
        ],

        editable=True,
        dropdown={
            'climate': {
                'options': [
                    {'label': i, 'value': i}
                    for i in df['climate'].unique()
                ]
            },
            'city': {
                 'options': [
                    {'label': i, 'value': i}
                    for i in df['city'].unique()
                ]
            }
        }
    ),
    html.Div(id='table-dropdown-container')
])

if __name__ == '__main__':
    app.run_server(debug=True)

@wbrgss
Copy link
Contributor Author

wbrgss commented Dec 12, 2019

In my version of Chrome, the

<div class="dash-dropdown-cell-value-container dash-cell-value-container" />

is rendered with a height of 30px by default (depends on font size), while on Firefox, it is rendered with a height of 25px.

This div has the following CSS applied:

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td .dash-cell-value-container {
    width: 100%;
    height: 100%;
}

In Firefox, if height is manually set to 30px, the issue is resolved (cell is clipped, not overflowing), even on very large font sizes:

image

I'm using
Chrome Version 78.0.3904.108 (Official Build) (64-bit) on PopOS (Ubuntu flavour)
and
Firefox 70.0.1 (64-bit) on the same OS.

Additional context (private repo): plotly/dash-design-kit#582

@wbrgss wbrgss self-assigned this Dec 12, 2019
@wbrgss
Copy link
Contributor Author

wbrgss commented Dec 12, 2019

Also note how the dropdown arrow / x is uncentered, and the overall height of the table is shorter, on the left (Firefox)

table diffs

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 a pull request may close this issue.

2 participants