Open bjfar opened 2 months ago
My offhand speculation is that clearing the CDS selection does not clear the table selection for rows that are off-screen. And then one of these two codepaths below gets invoked when the table viewport brings the previous selection back into view, so the table suddenly thinks there is a selection to update, and it happens to "win" by going "last".
Assuming so, a possible solution would be to more thoroughly clear the table's internal selection when the CDS selection is cleared.
Software versions
Python version : 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0] IPython version : 8.21.0 Tornado version : 6.4.1 Bokeh version : 3.5.1 BokehJS static path : /home/benf/micromamba/envs/testenv/lib/python3.10/site-packages/bokeh/server/static node.js version : v22.6.0 npm version : 10.8.2 jupyter_bokeh version : (not installed) Operating system : Linux-6.8.0-40-generic-x86_64-with-glibc2.35
Browser name and version
Firefox 129.0.1
Jupyter notebook / Jupyter Lab version
Jupyter notebook 6.4.12
Expected behavior
I have created a simple (x, y, t) dataset, and I am viewing (x, y) data in both a scatter plot and a data table using a CDSView that selects t-slices of the data using a slider and some customJS. I select points in the DataTable and they highlight as expected in the scatter plot. My clear button also clears the selection as expected.
When selecting at one t-slice, moving the slider, then clicking the "clear" button, I expect the selection indices in the underlying ColumnDataSource to be completely cleared, and for both the scatter plot and data table to reflect that.
Observed behavior
When selecting at one t-slice, moving the slider, then clicking the "clear" button, the selection is not cleared. Upon sliding back to the view where the selection was made, the old selection reappears.
Example code
Stack traceback or browser console output
No response
Screenshots
Selected points at t-slider value 79.
Press "clear" at t-slider value 80.
Slide back to value 79. Selection is still there. However the "clear" does work for data in the current "view" of the DataTable.