Missing on_click events and Javascript error in nested Tabulator

Hello, I’m using nested Tabulator widgets to display a hierarchy of objects. The nested Tabulators are dynamically created by the row_content function.

Issues:

  • when expanding a row of the second-level table I get the following Javascript error in the console: “Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?”
  • the first on_click event is not triggered (reproducible in the example app below). In my application several events are not triggered but I’m not able to reproduce this behavior with a minimal example.

Here is a minimal example to reproduce the issues:

import pandas as pd
import panel as pn

pn.extension('tabulator')

def on_table_click(event):
    alert.object = f'Event: {event}'
    alert.alert_type = 'success'

def second_nested_table(row):
    df = pd.DataFrame({
        'Product': ['Laptop', 'Smartphone', 'Tablet'],
        'Price': [1000, 500, 300],
        'Stock': [50, 200, 150]
    })
    table = pn.widgets.Tabulator(df, show_index=False, disabled=True)
    table.on_click(on_table_click)
    return pn.Row(pn.Spacer(width=50), table)

def first_nested_table(row):
    df = pd.DataFrame({
        'Hobby': ['Skiing', 'Soccer', 'Reading'],
        'Years': [10, 20, 30]
    })
    table = pn.widgets.Tabulator(df, show_index=False, row_content=second_nested_table)
    return pn.Row(pn.Spacer(width=50), table)

def main_table():
    df = pd.DataFrame({
        'Name': ['Alice', 'Bob', 'Charlie'],
        'Age': [25, 30, 35],
        'City': ['New York', 'Los Angeles', 'Chicago']
    })
    return pn.widgets.Tabulator(df, show_index=False, row_content=first_nested_table)

alert = pn.pane.Alert('No click events in the innermost table!', alert_type='info')
pn.Column(alert, main_table()).servable()

Can’t really help, but ran a quick test

  • get the same javascript error from the tabulator.js in the browser console, but tables seem fine to me
  • CAN NOT reproduce the on_click issue. Clicks on any of the fields in the innermost table work fine (even the first one). Tried a couple of times
    Tested on linux, python 3.12, panel 1.6.1, bokeh 3.6.3 with firefox 136.0.1

Thank you @johann . I tried again with different browsers on MacOS 13.7 and 14.x:

  • the javascript error occurs in both Chrome and Firefox 136.0.1
  • on_click works fine in Chrome, in Firefox the first 1-2 events are not triggered
  • for completeness I’ve also tested the app in Safari, but row expansion does not even work in Safari.

Attaching screenshot showing browser console with javascript error