diff --git a/Cargo.toml b/Cargo.toml index fc364dd15c..859ba837fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -137,7 +137,6 @@ features = [ 'DomRect', 'Element', 'Event', - "EventListenerOptions", 'EventTarget', 'FocusEvent', 'HtmlCanvasElement', diff --git a/src/platform_impl/web/web_sys/event_handle.rs b/src/platform_impl/web/web_sys/event_handle.rs index 9f9be48ad3..505d58a299 100644 --- a/src/platform_impl/web/web_sys/event_handle.rs +++ b/src/platform_impl/web/web_sys/event_handle.rs @@ -1,11 +1,10 @@ use wasm_bindgen::{prelude::Closure, JsCast}; -use web_sys::{EventListenerOptions, EventTarget}; +use web_sys::EventTarget; pub struct EventListenerHandle { target: EventTarget, event_type: &'static str, listener: Closure, - options: EventListenerOptions, } impl EventListenerHandle { @@ -21,7 +20,6 @@ impl EventListenerHandle { target, event_type, listener, - options: EventListenerOptions::new(), } } } @@ -29,10 +27,9 @@ impl EventListenerHandle { impl Drop for EventListenerHandle { fn drop(&mut self) { self.target - .remove_event_listener_with_callback_and_event_listener_options( + .remove_event_listener_with_callback( self.event_type, self.listener.as_ref().unchecked_ref(), - &self.options, ) .unwrap_or_else(|e| { web_sys::console::error_2(