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

Using DataTable row_selectable and row_deletable with fixed columns results in mismatched row heights #649

@shammamah-zz

Description

@shammamah-zz

Discovered while writing tests for #606.

Running this example:

import dash
import dash_table
import dash_html_components as html
import pandas as pd
import random

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv')

app = dash.Dash(__name__)

data = df.to_dict('records')
for d in data:
    d['country'] = (d['country']+'\n') * random.randint(1, 10)

app.layout = html.Div([
    dash_table.DataTable(
        id='datatable-interactivity',
        columns=[
            {"name": i, "id": i, "deletable": True, "selectable": True} for i in df.columns
        ],
        data=data,
        fixed_rows={'headers': True},
        fixed_columns={'headers': True},
        column_selectable="single",
        row_selectable="multi",
        row_deletable=True,
        page_action="native",
        page_current=0,
        page_size=100,
        style_data={
            'whiteSpace': 'pre',
            'height': 'auto'
        }
    )
])

app.run_server(debug=True)

Results in the following:

2019-11-21 12 47 24 localhost e342bec8b2a8

It appears as though the height of all rows in the row_selectable and row_deletable columns is set by the first cell in the first row that is not in a fixed column.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions