checkbox: Do not stop propagation when click (#1385)
This commit is contained in:
parent
1adaf3ec55
commit
43a2c814a3
4 changed files with 19 additions and 13 deletions
13
Cargo.toml
13
Cargo.toml
|
|
@ -1,7 +1,14 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["examples/hello_world", "examples/window_title", "crates/macros", "crates/story", "crates/ui", "examples/window_title", "examples/app_assets", "examples/app_assets", "examples/input"]
|
|
||||||
|
|
||||||
default-members = ["crates/story"]
|
default-members = ["crates/story"]
|
||||||
|
members = [
|
||||||
|
"crates/macros",
|
||||||
|
"crates/story",
|
||||||
|
"crates/ui",
|
||||||
|
"examples/app_assets",
|
||||||
|
"examples/hello_world",
|
||||||
|
"examples/input",
|
||||||
|
"examples/window_title",
|
||||||
|
]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
|
@ -11,9 +18,9 @@ story = { path = "crates/story" }
|
||||||
|
|
||||||
gpui = "0.2.0"
|
gpui = "0.2.0"
|
||||||
gpui-macros = "0.2.0"
|
gpui-macros = "0.2.0"
|
||||||
sum-tree = { version = "0.2.0", package = "zed-sum-tree" }
|
|
||||||
http-client = { version = "0.2.0", package = "zed-http-client" }
|
http-client = { version = "0.2.0", package = "zed-http-client" }
|
||||||
reqwest = { version = "0.12.15-zed", package = "zed-reqwest" }
|
reqwest = { version = "0.12.15-zed", package = "zed-reqwest" }
|
||||||
|
sum-tree = { version = "0.2.0", package = "zed-sum-tree" }
|
||||||
|
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gpui-component"
|
|
||||||
description = "UI components for building fantastic desktop application by using GPUI."
|
description = "UI components for building fantastic desktop application by using GPUI."
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
homepage = "https://github.com/longbridge/gpui-component"
|
homepage = "https://github.com/longbridge/gpui-component"
|
||||||
keywords = ["gpui", "uikit", "shadcn", "desktop", "ui"]
|
keywords = ["desktop", "gpui", "shadcn", "ui", "uikit"]
|
||||||
publish = true
|
|
||||||
version = "0.2.0"
|
|
||||||
readme = "../../README.md"
|
|
||||||
license-file = "LICENSE-APACHE"
|
license-file = "LICENSE-APACHE"
|
||||||
|
name = "gpui-component"
|
||||||
|
publish = true
|
||||||
|
readme = "../../README.md"
|
||||||
|
version = "0.2.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
@ -50,7 +50,7 @@ tree-sitter-languages = [
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
gpui = { workspace = true, features = ["test-support"] }
|
gpui = { workspace = true }
|
||||||
gpui-component-macros = { workspace = true }
|
gpui-component-macros = { workspace = true }
|
||||||
gpui-macros.workspace = true
|
gpui-macros.workspace = true
|
||||||
notify.workspace = true
|
notify.workspace = true
|
||||||
|
|
@ -62,8 +62,8 @@ serde_json.workspace = true
|
||||||
serde_repr.workspace = true
|
serde_repr.workspace = true
|
||||||
smallvec.workspace = true
|
smallvec.workspace = true
|
||||||
smol.workspace = true
|
smol.workspace = true
|
||||||
tracing.workspace = true
|
|
||||||
sum-tree.workspace = true
|
sum-tree.workspace = true
|
||||||
|
tracing.workspace = true
|
||||||
|
|
||||||
enum-iterator = "2.1.0"
|
enum-iterator = "2.1.0"
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
|
|
@ -111,7 +111,7 @@ tree-sitter-javascript = { version = "0.23.1", optional = true }
|
||||||
tree-sitter-jsdoc = { version = "0.23.2", optional = true }
|
tree-sitter-jsdoc = { version = "0.23.2", optional = true }
|
||||||
tree-sitter-json = "0.24.8"
|
tree-sitter-json = "0.24.8"
|
||||||
tree-sitter-make = { version = "1.1.1", optional = true }
|
tree-sitter-make = { version = "1.1.1", optional = true }
|
||||||
tree-sitter-md = { version = "0.5.1", optional = true }
|
tree-sitter-md = { version = "0.5.1", optional = true }
|
||||||
tree-sitter-proto = { version = "0.2.0", optional = true }
|
tree-sitter-proto = { version = "0.2.0", optional = true }
|
||||||
tree-sitter-python = { version = "0.23.6", optional = true }
|
tree-sitter-python = { version = "0.23.6", optional = true }
|
||||||
tree-sitter-ruby = { version = "0.23.1", optional = true }
|
tree-sitter-ruby = { version = "0.23.1", optional = true }
|
||||||
|
|
@ -125,6 +125,7 @@ tree-sitter-yaml = { version = "0.7.1", optional = true }
|
||||||
tree-sitter-zig = { version = "1.1.2", optional = true }
|
tree-sitter-zig = { version = "1.1.2", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
gpui = { workspace = true, features = ["test-support"] }
|
||||||
indoc = "2"
|
indoc = "2"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,6 @@ impl RenderOnce for Checkbox {
|
||||||
let on_click = self.on_click.clone();
|
let on_click = self.on_click.clone();
|
||||||
move |_, window, cx| {
|
move |_, window, cx| {
|
||||||
window.prevent_default();
|
window.prevent_default();
|
||||||
cx.stop_propagation();
|
|
||||||
Self::handle_click(&on_click, checked, window, cx);
|
Self::handle_click(&on_click, checked, window, cx);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,6 @@ impl RenderOnce for Radio {
|
||||||
let on_click = self.on_click.clone();
|
let on_click = self.on_click.clone();
|
||||||
move |_, window, cx| {
|
move |_, window, cx| {
|
||||||
window.prevent_default();
|
window.prevent_default();
|
||||||
cx.stop_propagation();
|
|
||||||
Self::handle_click(&on_click, checked, window, cx);
|
Self::handle_click(&on_click, checked, window, cx);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue