Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Raise a UIA TextSelectionChanged event when the TextInput caret/selection moves, so Narrator and braille displays announce character/word/line navigation during keyboard caret movement",
"packageName": "react-native-windows",
"email": "clintc@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,17 @@ void WindowsTextInputComponentView::OnSelectionChanged(LONG start, LONG end) noe
onSelectionChangeArgs.selection.end = end;
emitter->onSelectionChange(onSelectionChangeArgs);
}

// Notify UI Automation clients (e.g. Narrator and braille displays) that the caret or
// selection moved, so they re-read the current character/word/line during keyboard
// navigation. Without this, arrowing through the text is silent for screen readers.
// Mirrors the focus- and value-changed raises elsewhere in the Composition layer.
if (UiaClientsAreListening()) {
auto spProviderSimple = EnsureUiaProvider().try_as<IRawElementProviderSimple>();
if (spProviderSimple != nullptr) {
UiaRaiseAutomationEvent(spProviderSimple.get(), UIA_Text_TextSelectionChangedEventId);
}
}
}

std::string WindowsTextInputComponentView::GetTextFromRichEdit() const noexcept {
Expand Down