Skip to content

Commit

Permalink
chore: restore focus on context pad click
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Nov 7, 2024
1 parent 53d026e commit 5455eaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/features/context-pads/ContextPads.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down Expand Up @@ -275,6 +277,10 @@ ContextPads.prototype._updateElementContextPads = function(element, handler) {
: null;

_action(contexts);

if ('restoreFocus' in canvas) {
canvas.restoreFocus();
}
});
}

Expand Down

0 comments on commit 5455eaf

Please sign in to comment.