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
30846de3
Unverified
Commit
30846de3
authored
Mar 17, 2022
by
Justin McCandless
Committed by
GitHub
Mar 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Material text selection menu should not show pointer cursor (#100248)
parent
ff74557c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
desktop_text_selection.dart
...ages/flutter/lib/src/material/desktop_text_selection.dart
+2
-0
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+39
-0
No files found.
packages/flutter/lib/src/material/desktop_text_selection.dart
View file @
30846de3
...
...
@@ -332,6 +332,8 @@ class _DesktopTextSelectionToolbarButton extends StatelessWidget {
child:
TextButton
(
style:
TextButton
.
styleFrom
(
alignment:
Alignment
.
centerLeft
,
enabledMouseCursor:
SystemMouseCursors
.
basic
,
disabledMouseCursor:
SystemMouseCursors
.
basic
,
primary:
primary
,
shape:
const
RoundedRectangleBorder
(),
minimumSize:
const
Size
(
kMinInteractiveDimension
,
36.0
),
...
...
packages/flutter/test/material/text_field_test.dart
View file @
30846de3
...
...
@@ -10027,6 +10027,45 @@ void main() {
await
gesture
.
moveTo
(
center
);
});
testWidgets
(
'Text selection menu does not change mouse cursor when hovered'
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller
=
TextEditingController
(
text:
'Atwater Peel Sherbrooke Bonaventure'
,
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
MouseRegion
(
cursor:
SystemMouseCursors
.
forbidden
,
child:
TextField
(
controller:
controller
,
),
),
),
),
);
expect
(
find
.
text
(
'Copy'
),
findsNothing
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
textOffsetToPosition
(
tester
,
3
),
kind:
PointerDeviceKind
.
mouse
,
buttons:
kSecondaryMouseButton
,
);
addTearDown
(
gesture
.
removePointer
);
await
tester
.
pump
();
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
text
);
expect
(
find
.
text
(
'Copy'
),
findsOneWidget
);
await
gesture
.
moveTo
(
tester
.
getCenter
(
find
.
text
(
'Copy'
)));
expect
(
RendererBinding
.
instance
.
mouseTracker
.
debugDeviceActiveCursor
(
1
),
SystemMouseCursors
.
basic
);
},
variant:
TargetPlatformVariant
.
desktop
(),
skip:
isContextMenuProvidedByPlatform
,
// [intended] only applies to platforms where we supply the context menu.
);
testWidgets
(
'Caret rtl with changing width'
,
(
WidgetTester
tester
)
async
{
late
StateSetter
setState
;
bool
isWide
=
false
;
...
...
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