Skip to content

tickCross editor works poorly unexpected #8530

@mandelkow

Description

@mandelkow

ALL software version info

Python 3.12
Panel 1.8.10
MacOS 15.5
Various browsers: Firefox, Safari, Chrome,...

Description of expected behavior and the observed behavior

According to the documentation, the expected behavior for the display of an editable boolean column (False/True) would be to show checked / unchecked boxes or checkmarks / crosses. Instead, each cell alters between: empty, "true", "false", checked box, unchecked box. This weird behavior is actually observed in the documentation examples online: https://panel.holoviz.org/reference/widgets/Tabulator.html#editors-editing

Ideally, editable columns of type "tickCross" would behave exactly like the "selection" column you get with parameter selectable = "checkbox".

After further experimentation, I now understand the undesirable behavior: The display of a boolean cell changes during editing from "true" / "false" to checked / unchecked box and back. The parameter formatters={"Col1":{"type":"tickCross"}} will change the "display" to checkmarks / crosses, but the "editor" still displays checkboxes. Either way two clicks are required to toggle a value.

The display format and the editor format should really be the same. Everything else is very confusing.

Complete, minimal, self-contained example code that reproduces the issue

Note how the "selection" column behaves differently from Col1!

# code goes here between backticks
import pandas as pd
import panel as pn
pn.extension('tabulator')
Tb = pn.widgets.Tabulator( pd.DataFrame({'Col1':[False]*5}),
    pagination=None, height=800, 
    selectable="checkbox", # this shows checkboxes with expected desirable behavior
    editors={"Col1":{"type":"tickCross"}}, # this shows checkboxes, but only while editing
    formatters={"Col1":{"type":"tickCross"}}, # this shows checkmarks / crosses instead of false / true
)

Screenshots or screencasts of the bug in action

Just click some of the boolean cells in:
https://panel.holoviz.org/reference/widgets/Tabulator.html#editors-editing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions