Skip to content

Inconsistent Checkbox Functionality and Lack of Firefox Functionality #385

@colinbrust

Description

@colinbrust

I am using dash-ag-grid version 31.3.1 with dash 3.1.1. When using the default example on your website for selection using the header, there is inconsistent behavior between Firefox and Chrome. Additionally, it seems that some features are altogether not working in Firefox. The following issues I have found are:

  1. Using the defaults from the website, none of the checkboxes are selectable when using Firefox. I am only able to select checkboxes if I change the suppressRowClickSelection setting to False.
  2. On Firefox, when suppressRowClickSelection is false, I can only select multiple rows at a time if I hold the command key. Additionally, the header checkbox does not work and is not clickable.
  3. On Chrome, none of the above issues exist. However, I did notice that when suppressRowClickSelection is False, clicking a row rather than a checkbox will uncheck all previously checked boxes (unless you are holding the Command key).

For reference, here is the snippet of code I am using to test this. I have tested on Ubuntu, Windows and Mac machines with the same results. Interestingly, everything works as intended on all browsers when I use the examples embedded in the Dash website. Let me know if any other information would be helpful.

import dash_ag_grid as dag
from dash import Dash, html
import pandas as pd

app = Dash()

df = pd.read_csv(
    "https://raw.githubusercontent.com/plotly/datasets/master/ag-grid/olympic-winners.csv"
)

columnDefs = [
    {"field": "athlete"},
    {"field": "age"},
    {"field": "country"},
    {"field": "year"},
    {"field": "sport"},
    {"field": "total"},
]

app.layout = html.Div(
    [
        dag.AgGrid(
            id="row-selection-checkbox-header-function",
            columnDefs=columnDefs,
            rowData=df.to_dict("records"),
            columnSize="sizeToFit",
            defaultColDef={
                "filter": True,
                "checkboxSelection": {
                    "function": 'params.column == params.columnApi.getAllDisplayedColumns()[0]'
                },
                "headerCheckboxSelection": {
                    "function": 'params.column == params.columnApi.getAllDisplayedColumns()[0]'
                }
            },
            dashGridOptions={
                "rowSelection": "multiple",
                "suppressRowClickSelection": True,
                "animateRows": False
            },
        ),
    ],
)

if __name__ == "__main__":
    app.run(debug=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions