Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
af2d5bc5
Unverified
Commit
af2d5bc5
authored
Oct 06, 2022
by
Callum Moffat
Committed by
GitHub
Oct 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send text selection rects to engine on iPhone (#113048)
parent
00f36b64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+0
-8
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+4
-0
No files found.
packages/flutter/lib/src/widgets/editable_text.dart
View file @
af2d5bc5
...
...
@@ -63,10 +63,6 @@ const Duration _kCursorBlinkHalfPeriod = Duration(milliseconds: 500);
// is shown in an obscured text field.
const
int
_kObscureShowLatestCharCursorTicks
=
3
;
// The minimum width of an iPad screen. The smallest iPad is currently the
// iPad Mini 6th Gen according to ios-resolution.com.
const
double
_kIPadWidth
=
1488.0
;
/// A controller for an editable text field.
///
/// Whenever the user modifies a text field with an associated
...
...
@@ -3144,10 +3140,6 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
if
(
defaultTargetPlatform
!=
TargetPlatform
.
iOS
)
{
return
;
}
// This is to avoid sending selection rects on non-iPad devices.
if
(
WidgetsBinding
.
instance
.
window
.
physicalSize
.
shortestSide
<
_kIPadWidth
)
{
return
;
}
final
String
text
=
renderEditable
.
text
?.
toPlainText
(
includeSemanticsLabels:
false
)
??
''
;
final
List
<
Rect
>
firstSelectionBoxes
=
renderEditable
.
getBoxesForSelection
(
const
TextSelection
(
baseOffset:
0
,
extentOffset:
1
));
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
af2d5bc5
...
...
@@ -4624,6 +4624,10 @@ void main() {
});
testWidgets
(
'selection rects are sent when they change'
,
(
WidgetTester
tester
)
async
{
addTearDown
(
tester
.
binding
.
window
.
clearPhysicalSizeTestValue
);
// Ensure selection rects are sent on iPhone (using SE 3rd gen size)
tester
.
binding
.
window
.
physicalSizeTestValue
=
const
Size
(
750.0
,
1334.0
);
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
SystemChannels
.
textInput
.
setMockMethodCallHandler
((
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment