From 5455eaf2fb1dfaa724a63a4f4dd619d8a5800e28 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 7 Nov 2024 15:02:29 +0100 Subject: [PATCH] chore: restore focus on context pad click --- lib/features/context-pads/ContextPads.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/features/context-pads/ContextPads.js b/lib/features/context-pads/ContextPads.js index 05100763..a0643018 100644 --- a/lib/features/context-pads/ContextPads.js +++ b/lib/features/context-pads/ContextPads.js @@ -212,6 +212,8 @@ ContextPads.prototype.updateElementContextPads = function(element) { ContextPads.prototype._updateElementContextPads = function(element, handler) { + const canvas = this._canvas; + const contextPads = (handler.createContextPads(element) || []).filter(p => p); const handlerHash = `${element.id}------${handler.hash}`; @@ -275,6 +277,10 @@ ContextPads.prototype._updateElementContextPads = function(element, handler) { : null; _action(contexts); + + if ('restoreFocus' in canvas) { + canvas.restoreFocus(); + } }); }