fix the on double click event and depreciate ondblclick (#1743)
This commit is contained in:
1 parent
cde5ac5f58
commit
937be8b752
7 files changed
+143
-102
No files matched your search
@@ -119,10 +119,7 @@ impl_event! {
|
||||
/// oncontextmenu
|
||||
oncontextmenu
|
||||
|
||||
/// ondoubleclick
|
||||
ondoubleclick
|
||||
|
||||
/// ondoubleclick
|
||||
#[deprecated(since = "0.5.0", note = "use ondoubleclick instead")]
|
||||
ondblclick
|
||||
|
||||
/// onmousedown
|
||||
@@ -149,6 +146,19 @@ impl_event! {
|
||||
onmouseup
|
||||
}
|
||||
|
||||
/// ondoubleclick
|
||||
#[inline]
|
||||
pub fn ondoubleclick<'a, E: crate::EventReturn<T>, T>(_cx: &'a ::dioxus_core::ScopeState, mut _f: impl FnMut(::dioxus_core::Event<MouseData>) -> E + 'a) -> ::dioxus_core::Attribute<'a> {
|
||||
::dioxus_core::Attribute::new(
|
||||
"ondblclick",
|
||||
_cx.listener(move |e: ::dioxus_core::Event<MouseData>| {
|
||||
_f(e).spawn(_cx);
|
||||
}),
|
||||
None,
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
impl MouseData {
|
||||
/// Construct MouseData with the specified properties
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user