From 43a2c814a31d7f95c686312d3092505310b405a2 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Thu, 16 Oct 2025 14:01:06 +0800 Subject: [PATCH] checkbox: Do not stop propagation when click (#1385) --- Cargo.toml | 13 ++++++++++--- crates/ui/Cargo.toml | 17 +++++++++-------- crates/ui/src/checkbox.rs | 1 - crates/ui/src/radio.rs | 1 - 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e514f660..b0fe102e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,14 @@ [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"] +members = [ + "crates/macros", + "crates/story", + "crates/ui", + "examples/app_assets", + "examples/hello_world", + "examples/input", + "examples/window_title", +] resolver = "2" [workspace.dependencies] @@ -11,9 +18,9 @@ story = { path = "crates/story" } gpui = "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" } reqwest = { version = "0.12.15-zed", package = "zed-reqwest" } +sum-tree = { version = "0.2.0", package = "zed-sum-tree" } anyhow = "1" log = "0.4" diff --git a/crates/ui/Cargo.toml b/crates/ui/Cargo.toml index ccdb3272..17a7d5c4 100644 --- a/crates/ui/Cargo.toml +++ b/crates/ui/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "gpui-component" description = "UI components for building fantastic desktop application by using GPUI." edition = "2021" homepage = "https://github.com/longbridge/gpui-component" -keywords = ["gpui", "uikit", "shadcn", "desktop", "ui"] -publish = true -version = "0.2.0" -readme = "../../README.md" +keywords = ["desktop", "gpui", "shadcn", "ui", "uikit"] license-file = "LICENSE-APACHE" +name = "gpui-component" +publish = true +readme = "../../README.md" +version = "0.2.0" [lib] doctest = false @@ -50,7 +50,7 @@ tree-sitter-languages = [ [dependencies] anyhow.workspace = true -gpui = { workspace = true, features = ["test-support"] } +gpui = { workspace = true } gpui-component-macros = { workspace = true } gpui-macros.workspace = true notify.workspace = true @@ -62,8 +62,8 @@ serde_json.workspace = true serde_repr.workspace = true smallvec.workspace = true smol.workspace = true -tracing.workspace = true sum-tree.workspace = true +tracing.workspace = true enum-iterator = "2.1.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-json = "0.24.8" 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-python = { version = "0.23.6", 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 } [dev-dependencies] +gpui = { workspace = true, features = ["test-support"] } indoc = "2" [lints] diff --git a/crates/ui/src/checkbox.rs b/crates/ui/src/checkbox.rs index 68c6c8ae..a5b4a129 100644 --- a/crates/ui/src/checkbox.rs +++ b/crates/ui/src/checkbox.rs @@ -295,7 +295,6 @@ impl RenderOnce for Checkbox { let on_click = self.on_click.clone(); move |_, window, cx| { window.prevent_default(); - cx.stop_propagation(); Self::handle_click(&on_click, checked, window, cx); } }) diff --git a/crates/ui/src/radio.rs b/crates/ui/src/radio.rs index a3e86278..039b634b 100644 --- a/crates/ui/src/radio.rs +++ b/crates/ui/src/radio.rs @@ -215,7 +215,6 @@ impl RenderOnce for Radio { let on_click = self.on_click.clone(); move |_, window, cx| { window.prevent_default(); - cx.stop_propagation(); Self::handle_click(&on_click, checked, window, cx); } })