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
82bf3189
Unverified
Commit
82bf3189
authored
Dec 14, 2021
by
Tong Mu
Committed by
GitHub
Dec 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete and Backspace shortcuts accept optional Shift modifier (#94966)
parent
8b198d60
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
183 deletions
+216
-183
default_text_editing_shortcuts.dart
...utter/lib/src/widgets/default_text_editing_shortcuts.dart
+172
-183
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+44
-0
No files found.
packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
View file @
82bf3189
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/editable_text_test.dart
View file @
82bf3189
...
@@ -5037,6 +5037,50 @@ void main() {
...
@@ -5037,6 +5037,50 @@ void main() {
reason:
'on
$platform
'
,
reason:
'on
$platform
'
,
);
);
expect
(
controller
.
text
,
isEmpty
,
reason:
'on
$platform
'
);
expect
(
controller
.
text
,
isEmpty
,
reason:
'on
$platform
'
);
controller
.
text
=
'abc'
;
controller
.
selection
=
const
TextSelection
(
baseOffset:
2
,
extentOffset:
2
);
// Backspace
await
sendKeys
(
tester
,
<
LogicalKeyboardKey
>[
LogicalKeyboardKey
.
backspace
,
],
targetPlatform:
defaultTargetPlatform
,
);
expect
(
selection
,
equals
(
const
TextSelection
(
baseOffset:
1
,
extentOffset:
1
,
),
),
reason:
'on
$platform
'
,
);
expect
(
controller
.
text
,
'ac'
,
reason:
'on
$platform
'
);
// Shift-backspace (same as backspace)
await
sendKeys
(
tester
,
<
LogicalKeyboardKey
>[
LogicalKeyboardKey
.
backspace
,
],
shift:
true
,
targetPlatform:
defaultTargetPlatform
,
);
expect
(
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
extentOffset:
0
,
),
),
reason:
'on
$platform
'
,
);
expect
(
controller
.
text
,
'c'
,
reason:
'on
$platform
'
);
}
}
testWidgets
(
'keyboard text selection works (RawKeyEvent)'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'keyboard text selection works (RawKeyEvent)'
,
(
WidgetTester
tester
)
async
{
...
...
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