mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 06:00:56 -05:00
Improve handling of previously focused view.
Make sure we switch back to the original one if there are multiple neighboring views.
This commit is contained in:
parent
cee3959bfa
commit
5f44d814f5
1 changed files with 3 additions and 1 deletions
|
@ -810,7 +810,8 @@ new function() { // Injection scope for mouse events on the browser
|
|||
// view, to let items receive receive a mouseleave, etc.
|
||||
if (view)
|
||||
handleMouseMove(view, event);
|
||||
prevFocus = view;
|
||||
if (!prevFocus)
|
||||
prevFocus = view;
|
||||
view = View._focused = tempFocus = target;
|
||||
}
|
||||
} else if (tempFocus && tempFocus === view) {
|
||||
|
@ -819,6 +820,7 @@ new function() { // Injection scope for mouse events on the browser
|
|||
if (prevFocus && !prevFocus.isInserted())
|
||||
prevFocus = null;
|
||||
view = View._focused = prevFocus;
|
||||
prevFocus = null;
|
||||
updateFocus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue