Handle quick Cursor detach after mouse up
This timer might fire after the Cursor object has detached from a DOM element, causing crashes. This will likely not happen in real scenarios, but the tests are quick enough to trigger this.
This commit is contained in:
parent
6c6776a7a0
commit
484a9551d1
|
@ -179,6 +179,10 @@ export default class Cursor {
|
||||||
// should be visible.
|
// should be visible.
|
||||||
if (this._captureIsActive()) {
|
if (this._captureIsActive()) {
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
|
// We might have detached at this point
|
||||||
|
if (!this._target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Refresh the target from elementFromPoint since queued events
|
// Refresh the target from elementFromPoint since queued events
|
||||||
// might have altered the DOM
|
// might have altered the DOM
|
||||||
target = document.elementFromPoint(event.clientX,
|
target = document.elementFromPoint(event.clientX,
|
||||||
|
|
Loading…
Reference in New Issue