mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-23 20:10:12 +08:00
apply TextSelectionMenuFix
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -4301,7 +4301,7 @@ class EditableTextState extends State<EditableText>
|
||||
return;
|
||||
}
|
||||
_showToolbarOnScreenScheduled = true;
|
||||
SchedulerBinding.instance.addPostFrameCallback((Duration _) {
|
||||
void scheduleToolbar(Duration _) {
|
||||
_showToolbarOnScreenScheduled = false;
|
||||
if (!mounted || _dataWhenToolbarShowScheduled == null) {
|
||||
return;
|
||||
@@ -4331,7 +4331,25 @@ class EditableTextState extends State<EditableText>
|
||||
showToolbar();
|
||||
_dataWhenToolbarShowScheduled = null;
|
||||
}
|
||||
}, debugLabel: 'EditableText.scheduleToolbar');
|
||||
}
|
||||
|
||||
switch (SchedulerBinding.instance.schedulerPhase) {
|
||||
case SchedulerPhase.idle:
|
||||
case SchedulerPhase.postFrameCallbacks:
|
||||
// During these scheduler phases we cannot guarantee
|
||||
// there will be a frame after, so we use scheduleFrameCallback.
|
||||
SchedulerBinding.instance.scheduleFrameCallback(scheduleToolbar);
|
||||
case SchedulerPhase.transientCallbacks:
|
||||
case SchedulerPhase.midFrameMicrotasks:
|
||||
case SchedulerPhase.persistentCallbacks:
|
||||
// During an active frame we can still schedule
|
||||
// a post-frame callback to be run after the
|
||||
// current frame.
|
||||
SchedulerBinding.instance.addPostFrameCallback(
|
||||
scheduleToolbar,
|
||||
debugLabel: 'EditableText.scheduleToolbar',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user