Skip to content

Datagrid selection and filtering may break app #1390

@Will-S-Revmed

Description

@Will-S-Revmed

This is on version 0.9.0
It appears that, when using the built in filters on datagrids, if any rows are selected, the datagrid may break (becomes unresponsive, graphical errors). It also breaks the entire app with it in my experience, in particular, other datagrids become unresponsive.

Minimal example:

import pandas as pd
from shiny import App, render, ui

df = pd.DataFrame(data={'a': [str(i) for i in range(10)]})

app_ui = ui.page_fluid(
    ui.output_data_frame(id='my_df')
)


def server(input, output, session):
    @render.data_frame
    def my_df():
        return render.DataGrid(
            data=df,
            filters=True,
            selection_mode='rows'
        )


app = App(app_ui, server)

To recreate the behaviour, first select a row, and then type in something in the filter such that the selected row won't appear. The data grid will subsequently break. It seems like the conditions under which the bug occurs are when what is typed in the filter will exclude any of the selected rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdata frameRelated to @render.data_frame

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions