wip: pass more events

This commit is contained in:
Jonathan Kelley committed 2022-11-15 16:37:23 -08:00
1 parent 47d0f51e00
commit 0dad91bc08
20 files changed
+773 -31

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
use dioxus::{events::*, prelude::*};
use dioxus::{events::*, html::MouseEvent, prelude::*};
fn main() {
dioxus_desktop::launch(app);
+1 -1
View File
@@ -14,7 +14,7 @@ use dioxus_desktop::Config;
fn main() {
let vdom = VirtualDom::new(app);
let content = dioxus_ssr::render_vdom_cfg(&vdom, |f| f.pre_render(true));
let content = dioxus_ssr::pre_render(&vdom);
dioxus_desktop::launch_cfg(app, Config::new().with_prerendered(content));
}
+1 -1
View File
@@ -2,7 +2,7 @@
//!
//! There is some conversion happening when input types are checkbox/radio/select/textarea etc.
use dioxus::events::FormEvent;
use dioxus::events::FormData;
use dioxus::prelude::*;
fn main() {
+2 -4
View File
@@ -1,7 +1,6 @@
//! This example demonstrates the following:
//! Futures in a callback, Router, and Forms
use dioxus::events::*;
use dioxus::prelude::*;
fn main() {
@@ -37,11 +36,10 @@ fn app(cx: Scope) -> Element {
form {
onsubmit: onsubmit,
prevent_default: "onsubmit", // Prevent the default behavior of <form> to post
input { "type": "text", id: "username", name: "username" }
input { r#type: "text", id: "username", name: "username" }
label { "Username" }
br {}
input { "type": "password", id: "password", name: "password" }
input { r#type: "password", id: "password", name: "password" }
label { "Password" }
br {}
button { "Login" }
+1
View File
@@ -19,6 +19,7 @@
use dioxus::events::*;
use dioxus::html::input_data::keyboard_types::Key;
use dioxus::html::MouseEvent;
use dioxus::prelude::*;
use dioxus_desktop::wry::application::dpi::LogicalSize;
use dioxus_desktop::{Config, WindowBuilder};
+1 -2
View File
@@ -1,6 +1,6 @@
// Thanks to @japsu and their project https://github.com/japsu/jatsi for the example!
use dioxus::{events::MouseEvent, prelude::*};
use dioxus::{events::MouseData, html::MouseEvent, prelude::*};
fn main() {
dioxus_desktop::launch(app);
@@ -82,7 +82,6 @@ pub fn Die<'a>(cx: Scope<'a, DieProps<'a>>) -> Element {
svg {
onclick: move |e| cx.props.onclick.call(e),
prevent_default: "onclick",
"dioxus-prevent-default": "onclick",
class: "die",
view_box: "-1000 -1000 2000 2000",