Interactive plot with ipywidgets and pyvista trame hangs after interaction

After first interaction with an interactive Pyvista Trame plot, Jupyterlab hangs . The kernel status stays ‘busy’.
In the examle below, I tried to choose the plot with ipywidget checkboxes. After running the cell, the the saddle is shown in a trame plot. But after the first click to the ‘red’ checkbox the notebook freezes.

Did I miss something?

import ipywidgets as widgets
import pyvista as pv

pv.set_jupyter_backend('trame')

dataset = pv.examples.download_saddle_surface()

red_check_box = widgets.Checkbox(False, description="red")
green_check_box = widgets.Checkbox(False, description="green")
ui = widgets.HBox([red_check_box, green_check_box])

def draw_saddle(red, green):
    print(f"{red=}, {green=}")
    if red:
        dataset.plot(color='red')  # plot() returns Plotter.show()
    elif green:
        dataset.plot(color='green')
    else:
        dataset.plot(color='grey')


out = widgets.interactive_output(
    draw_saddle,
    {
        'red': red_check_box,
        'green': green_check_box
    },
)

display(ui, out)

Jupyterlab Version 4.4.4
pyvista version ‘0.45.2’
ipywidgets 5.0.15

https://www.youtube.com/watch?v=HDxn8rcPc1Q code works just right for me.

Given what nasrin says, I’d encourage you to restart everything on your machine, including the machine itself and do a hard fresh of the browser page where you are running this .ipynb file. The communication can sometimes not happen if all the connections aren’t set up properly. And getting the browser to use the right code often requires clearing things out a bit.