mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): allow passing passive option to addEvent (#58316)
For scroll-blocking events like 'touchstart', 'touchmove', 'wheel' and 'mousewheel', if passive option is not specified when adding the event listener, browser may give a violation warning. This PR allows us to set the passive option when calling event lib's addEvent(). PR Close #58316
This commit is contained in:
parent
f34268161b
commit
d7283bf740
1 changed files with 2 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ export interface EarlyJsactionDataContainer {
|
|||
// @public
|
||||
export class EventContract implements UnrenamedEventContract {
|
||||
constructor(containerManager: EventContractContainerManager);
|
||||
addEvent(eventType: string, prefixedEventType?: string): void;
|
||||
addEvent(eventType: string, prefixedEventType?: string, passive?: boolean): void;
|
||||
cleanUp(): void;
|
||||
ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
|
||||
handler(eventType: string): EventHandler | undefined;
|
||||
|
|
@ -42,7 +42,7 @@ export class EventContract implements UnrenamedEventContract {
|
|||
// @public
|
||||
export class EventContractContainer implements EventContractContainerManager {
|
||||
constructor(element: Element);
|
||||
addEventListener(eventType: string, getHandler: (element: Element) => (event: Event) => void): void;
|
||||
addEventListener(eventType: string, getHandler: (element: Element) => (event: Event) => void, passive?: boolean): void;
|
||||
cleanUp(): void;
|
||||
// (undocumented)
|
||||
readonly element: Element;
|
||||
|
|
|
|||
Loading…
Reference in a new issue