Visual selection is not adjusted when changing text selection with TalkBack (#32832)

This commit is contained in:
chunhtai 2019-05-16 14:41:39 -07:00 committed by GitHub
parent 900875fd3f
commit 3f92640521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View file

@ -3032,7 +3032,8 @@ class SemanticsConfiguration {
set onSetSelection(SetSelectionHandler value) {
assert(value != null);
_addAction(SemanticsAction.setSelection, (dynamic args) {
final Map<String, int> selection = args;
assert(args != null && args is Map);
final Map<String, int> selection = args.cast<String, int>();
assert(selection != null && selection['base'] != null && selection['extent'] != null);
value(TextSelection(
baseOffset: selection['base'],

View file

@ -3939,7 +3939,7 @@ void main() {
), ignoreTransform: true, ignoreRect: true));
// move cursor back once
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <String, int>{
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <dynamic, dynamic>{
'base': 4,
'extent': 4,
});
@ -3947,7 +3947,7 @@ void main() {
expect(controller.selection, const TextSelection.collapsed(offset: 4));
// move cursor to front
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <String, int>{
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <dynamic, dynamic>{
'base': 0,
'extent': 0,
});
@ -3955,7 +3955,7 @@ void main() {
expect(controller.selection, const TextSelection.collapsed(offset: 0));
// select all
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <String, int>{
semanticsOwner.performAction(inputFieldId, SemanticsAction.setSelection, <dynamic, dynamic>{
'base': 0,
'extent': 5,
});

View file

@ -443,7 +443,7 @@ void main() {
semanticsOwner.performAction(expectedId, action, true);
break;
case SemanticsAction.setSelection:
semanticsOwner.performAction(expectedId, action, <String, int>{
semanticsOwner.performAction(expectedId, action, <dynamic, dynamic>{
'base': 4,
'extent': 5,
});