From fea0fb29c39f5a747e81d7caff735ec17a3ed6b3 Mon Sep 17 00:00:00 2001 From: Jarek Danielak Date: Wed, 20 Nov 2024 10:47:07 +0100 Subject: [PATCH] chore: better restoreFocus check --- src/render/BpmnPropertiesPanelRenderer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/render/BpmnPropertiesPanelRenderer.js b/src/render/BpmnPropertiesPanelRenderer.js index 24546755..9a43841a 100644 --- a/src/render/BpmnPropertiesPanelRenderer.js +++ b/src/render/BpmnPropertiesPanelRenderer.js @@ -165,7 +165,11 @@ export default class BpmnPropertiesPanelRenderer { _restoreCanvasFocus() { const canvas = this._injector.get('canvas'); - canvas && canvas.restoreFocus && canvas.restoreFocus(); + + // Only available with diagram-js >= 15.0.0 + if (canvas.restoreFocus) { + canvas.restoreFocus(); + } } _render(element) {