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..5665649dda 100644 --- a/panel/models/modal.py +++ b/panel/models/modal.py @@ -1,7 +1,7 @@ from typing import Any from bokeh.core.properties import Bool -from bokeh.events import ModelEvent +from bokeh.events import Model, ModelEvent from ..io.resources import bundled_files from ..util import classproperty @@ -44,7 +44,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)