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

[BUG] DataTable javascript error with row_selectable and filter_action #1854

Closed
jchang10 opened this issue Dec 4, 2021 · 5 comments
Closed
Labels
good first issue suitable for newcomers

Comments

@jchang10
Copy link
Contributor

jchang10 commented Dec 4, 2021

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                      2.0.0
dash-bootstrap-components 1.0.0
  • if frontend related, tell us your Browser, Version and OS

    • OS: [e.g. iOS] Windows
    • Browser [e.g. chrome, safari]: Chrome 96.0x, Edge 96.0x, Firefox 90.0 All report same Javascript error
    • Version [e.g. 22]

Describe the bug

DataTable with row_selectable="single or multi" and filter_action="native" seems to cause the JS error. This especially happens when data=[] and colums=[] or empty values.

Expected behavior

JS Error should not occur

Screenshots

This is the simplest example.

import dash
import dash_bootstrap_components as dbc
from dash import html
from dash.html import Div, Span
from dash_bootstrap_components import Row, Col
from dash import dcc
from dash import dash_table


layout = \
    Div([

        dash_table.DataTable(id='tasks-table',
            row_selectable='single',
            tooltip_duration=None,
            page_size=10,
            filter_action='native',
        ),

    ])

app = dash.Dash(__name__)

app.layout = layout

if __name__ == '__main__':
    app.run_server(debug=True, host='0.0.0.0', port=8000)

image

@chriddyp chriddyp added the good first issue suitable for newcomers label Feb 10, 2022
@shakri0
Copy link

shakri0 commented May 15, 2022

Hai

@aneeshdua
Copy link

@chriddyp Can I pick this up? (Wanted to start contributing to dash as I love using it in my professional work)

@alexcjohnson
Copy link
Collaborator

@aneeshdua absolutely! If you run into any trouble getting set up or finding the relevant pieces of code, the best might be to ping me on the forum https://community.plotly.com/u/alexcjohnson

@aneeshdua
Copy link

@jchang10 @alexcjohnson I am not able to reproduce the bug (with the same code). Here are the details of my environment:

  • replace the result of pip list | grep dash below:
dash                            2.7.1
dash-bootstrap-components       1.3.0
dash-core-components            2.0.0
dash-dangerously-set-inner-html 0.0.2
dash-flow-example               0.0.5
dash-html-components            2.0.0
dash-table                      5.0.0
  • if frontend related, tell us your Browser, Version and OS

OS: [e.g. iOS] Windows
Browser [e.g. chrome, safari]: Chrome 108.0x, Edge 108.0x, Firefox 108.0x

image

I am using newer versions of dash (2.7.1) as compared to the one in which the bug occurred (2.0.0). It could be possible that the bug got fixed over the updates.

@alexcjohnson
Copy link
Collaborator

Yes, looks like you're right - if I run the app above with Dash v2.0.0 I see the JS error:

Cannot read properties of undefined (reading '0')

But there's no error in Dash 2.7.1

Thanks for investigating @aneeshdua!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue suitable for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants