diff --git a/panel/layout/modal.py b/panel/layout/modal.py index a9edf9ff36..1dbc9e49d9 100644 --- a/panel/layout/modal.py +++ b/panel/layout/modal.py @@ -38,7 +38,7 @@ def _get_model( self, doc: Document, root: Optional[Model] = None, parent: Optional[Model] = None, comm: Optional[Comm] = None ) -> Model: - self._bokeh_model = lazy_load( + Modal._bokeh_model = lazy_load( 'panel.models.modal', 'Modal', isinstance(comm, JupyterComm), root ) return super()._get_model(doc, root, parent, comm) diff --git a/panel/models/modal.py b/panel/models/modal.py index cad556b78f..5083751d0e 100644 --- a/panel/models/modal.py +++ b/panel/models/modal.py @@ -2,6 +2,7 @@ from bokeh.core.properties import Bool from bokeh.events import ModelEvent +from bokeh.model import Model from ..io.resources import bundled_files from ..util import classproperty @@ -44,7 +45,7 @@ def __js_skip__(cls): class ModalDialogEvent(ModelEvent): event_name = 'modal-dialog-event' - def __init__(self, model: ModelEvent, open: bool): + def __init__(self, model: Model | None, open: bool): self.open = open super().__init__(model=model)