Skip to content

Commit

Permalink
feat(domeventobserver): ckeditor#16412 add support for usePassive opt…
Browse files Browse the repository at this point in the history
…ion to the DomEventObserver

Fixes ckeditor#16412
  • Loading branch information
timblack1-WC authored Jun 3, 2024
1 parent 2dd6cc3 commit 3fd861c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export default abstract class DomEventObserver<
*/
public useCapture: boolean = false;

/**
* If set to `true`, indicates that the function specified by listener will never call preventDefault()
* Default value is `false`.
*/
public usePassive: boolean = false;

/**
* Callback which should be called when the DOM event occurred. Note that the callback will not be called if
* observer {@link #isEnabled is not enabled}.
Expand All @@ -75,7 +81,7 @@ export default abstract class DomEventObserver<
if ( this.isEnabled && !this.checkShouldIgnoreEventFromTarget( domEvent.target as any ) ) {
this.onDomEvent( domEvent );
}
}, { useCapture: this.useCapture } );
}, { useCapture: this.useCapture, usePassive: this.usePassive } );
} );
}

Expand Down

0 comments on commit 3fd861c

Please sign in to comment.