From 108f1af8125ac90db942f6343c0d4b86abab30cd Mon Sep 17 00:00:00 2001 From: Melissa Date: Mon, 18 May 2026 18:25:25 +0200 Subject: [PATCH] Added macOS events for expand & collapse events (#21043) * Added macOS events for expand & collapse events * Fix CFString bridging to NSString * Don't use ExpandCollapseProvider functions when event was not for ExpandCollapseProvider --------- Co-authored-by: Adam Demasi Co-authored-by: Julien Lebosquain --- native/Avalonia.Native/src/OSX/automation.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/Avalonia.Native/src/OSX/automation.mm b/native/Avalonia.Native/src/OSX/automation.mm index 78552f716e..9bc4b0124c 100644 --- a/native/Avalonia.Native/src/OSX/automation.mm +++ b/native/Avalonia.Native/src/OSX/automation.mm @@ -509,8 +509,14 @@ NSAccessibilityPostNotification(self, NSAccessibilitySelectedChildrenChangedNotification); break; case ToggleProvider_ToggleState: + NSAccessibilityPostNotification(self, NSAccessibilityValueChangedNotification); + break; case ExpandCollapseProvider_ExpandCollapseState: NSAccessibilityPostNotification(self, NSAccessibilityValueChangedNotification); + if (_peer->ExpandCollapseProvider_GetIsExpanded()) + NSAccessibilityPostNotification(self, (__bridge NSString *)kAXRowExpandedNotification); + else + NSAccessibilityPostNotification(self, (__bridge NSString *)kAXRowCollapsedNotification); break; default: break;