Skip to content

Commit

Permalink
fix: cancel any raf before creating a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Mar 29, 2022
1 parent f8ba3ee commit c901c10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/backend-html5/src/HTML5BackendImpl.ts
Expand Up @@ -406,6 +406,9 @@ export class HTML5BackendImpl implements Backend {
this.hoverRafId === null &&
typeof requestAnimationFrame !== 'undefined'
) {
// cancel any existing hover if present
this.cancelHover()

this.hoverRafId = requestAnimationFrame(() => {
if (this.monitor.isDragging()) {
this.actions.hover(dragOverTargetIds || [], {
Expand Down

0 comments on commit c901c10

Please sign in to comment.