From 20b584398e6151f0950f18a2579b4ee0b4012c96 Mon Sep 17 00:00:00 2001 From: Remco Smits Date: Thu, 27 Nov 2025 21:12:03 +0100 Subject: [PATCH] checkbox: Fix showing cursor pointer for edge of the checkbox when it's disabled (#43577) This PR fixes that you saw the cursor pointer for disabled checkbox. This is only for the edge of the checkbox component, because we didn't check for the disabled case. **Before** https://github.com/user-attachments/assets/cfebad01-533b-4515-b8d9-4bcb839eaec4 **After** https://github.com/user-attachments/assets/969600de-081b-42df-a288-ca3db5758d12 Release Notes: - N/A --- crates/ui/src/components/toggle.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/components/toggle.rs b/crates/ui/src/components/toggle.rs index a41dce6c61de1cabdbccee1478afe143feee4987..1e637f24194b86f0c06aef806975df635f45a6cd 100644 --- a/crates/ui/src/components/toggle.rs +++ b/crates/ui/src/components/toggle.rs @@ -247,7 +247,13 @@ impl RenderOnce for Checkbox { h_flex() .id(self.id) - .cursor_pointer() + .map(|this| { + if self.disabled { + this.cursor_not_allowed() + } else { + this.cursor_pointer() + } + }) .gap(DynamicSpacing::Base06.rems(cx)) .child(checkbox) .when_some(