Hide the emulated cursor when target is null

Makes it easier to understand what happens when a real element isn't
passed as a target to updateVisibility(). Also makes the code more
robust to future changes.

Co-authored-by: Alex Tanskanen <aleta@cendio.se>
Co-authored-by: Niko Lehto <nikle@cendio.se>
This commit is contained in:
Samuel Mannehed 2019-10-21 11:27:43 +02:00 committed by Lauri Kasanen
parent fb14c2dec9
commit 996895268e

View File

@ -209,6 +209,9 @@ export default class Cursor {
// (i.e. are we over the target, or a child of the target without a
// different cursor set)
_shouldShowCursor(target) {
if (!target) {
return false;
}
// Easy case
if (target === this._target) {
return true;