-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement IValueProvider #12263
base: main
Are you sure you want to change the base?
Implement IValueProvider #12263
Changes from 5 commits
fe357d7
d22a18c
3e0df00
11fb0a5
8a2b5ee
4178883
af06e6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "value provider changes", | ||
"packageName": "react-native-windows", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1305,6 +1305,17 @@ void CompositionBaseComponentView::EnsureTransformMatrixFacade() noexcept { | |
} | ||
} | ||
|
||
void CompositionBaseComponentView::updateAccessibilityValue(std::string newValue) noexcept { | ||
auto props = std::static_pointer_cast<const facebook::react::ViewProps>(this->props()); | ||
if (newValue != props->accessibilityValue.text) { | ||
auto provider = EnsureUiaProvider(); | ||
if (provider != nullptr) { | ||
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty( | ||
provider, UIA_ValueValuePropertyId, *props->accessibilityValue.text, newValue); | ||
} | ||
} | ||
} | ||
|
||
facebook::react::SharedViewEventEmitter CompositionBaseComponentView::eventEmitter() noexcept { | ||
return m_eventEmitter; | ||
} | ||
|
@@ -1387,6 +1398,12 @@ void CompositionViewComponentView::updateProps( | |
m_visual.Opacity(newViewProps.opacity); | ||
} | ||
|
||
if (oldViewProps.accessibilityValue.text.has_value() && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does this change address this issue - whenever updateProps() is called, if accessibilityValue.text has changed, it will be modified and UpdateUiaProperty() will be called. |
||
newViewProps.accessibilityValue.text.has_value() && | ||
oldViewProps.accessibilityValue.text != newViewProps.accessibilityValue.text) { | ||
updateAccessibilityValue(*newViewProps.accessibilityValue.text); | ||
} | ||
|
||
// update BaseComponentView props | ||
updateAccessibilityProps(oldViewProps, newViewProps); | ||
updateShadowProps(oldViewProps, newViewProps, m_visual); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acoates-ms The value being set in SetValue() goes here and then is modified through a call to UpdateUiaProperty() - which from my understanding also calls the UiaRaiseAutomationPropertyChangedEvent(), updating insights that the property has changed. Do I still need to add a UiaRaiseAutomationEvent() here as well?