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
6669aafa
Commit
6669aafa
authored
Oct 23, 2015
by
Jason Simmons
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1759 from jason-simmons/edit_text_keyboard_flicker
Hide the keyboard in a deferred task.
parents
375f3247
6c98721d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
keyboard.dart
packages/flutter/lib/src/services/keyboard.dart
+19
-1
No files found.
packages/flutter/lib/src/services/keyboard.dart
View file @
6669aafa
...
...
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:mojo_services/keyboard/keyboard.mojom.dart'
;
import
'shell.dart'
;
...
...
@@ -32,6 +34,8 @@ class Keyboard {
KeyboardHandle
_currentHandle
;
bool
_hidePending
=
false
;
KeyboardHandle
show
(
KeyboardClientStub
stub
,
KeyboardType
keyboardType
)
{
assert
(
stub
!=
null
);
if
(
_currentHandle
!=
null
)
{
...
...
@@ -43,6 +47,20 @@ class Keyboard {
return
_currentHandle
;
}
void
_scheduleHide
()
{
if
(
_hidePending
)
return
;
_hidePending
=
true
;
// Schedule a deferred task that hides the keyboard. If someone else shows
// the keyboard during this update cycle, then the task will do nothing.
scheduleMicrotask
(()
{
_hidePending
=
false
;
if
(
_currentHandle
==
null
)
{
service
.
hide
();
}
});
}
}
class
KeyboardHandle
{
...
...
@@ -70,9 +88,9 @@ class KeyboardHandle {
void
release
()
{
if
(
_attached
)
{
assert
(
_keyboard
.
_currentHandle
==
this
);
_keyboard
.
service
.
hide
();
_attached
=
false
;
_keyboard
.
_currentHandle
=
null
;
_keyboard
.
_scheduleHide
();
}
assert
(
_keyboard
.
_currentHandle
!=
this
);
}
...
...
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