mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
Visual selection is not adjusted when changing text selection with TalkBack (#32832)
This commit is contained in:
parent
900875fd3f
commit
3f92640521
|
@ -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'],
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue