From 449c3a5a0de0d6387a4c7448637975bc54de6eec Mon Sep 17 00:00:00 2001 From: holgerchristensen Date: Sun, 27 Oct 2024 17:40:36 +0100 Subject: [PATCH] Add isEnabled to MacOS adapter --- platforms/macos/src/node.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platforms/macos/src/node.rs b/platforms/macos/src/node.rs index 52601333..73f8cbc5 100644 --- a/platforms/macos/src/node.rs +++ b/platforms/macos/src/node.rs @@ -523,6 +523,11 @@ declare_class!( .unwrap_or(false) } + #[method(isAccessibilityEnabled)] + fn enabled(&self) -> bool { + self.resolve(|node| !node.is_disabled()).unwrap_or(true) + } + #[method(setAccessibilityFocused:)] fn set_focused(&self, focused: bool) { self.resolve_with_context(|node, context| { @@ -806,6 +811,7 @@ declare_class!( || selector == sel!(accessibilityChildrenInNavigationOrder) || selector == sel!(accessibilityFrame) || selector == sel!(accessibilityRole) + || selector == sel!(isAccessibilityEnabled) || selector == sel!(accessibilityWindow) || selector == sel!(accessibilityTopLevelUIElement) || selector == sel!(accessibilityRoleDescription)