mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-24 12:30:12 +08:00
replace SelectableText with SelectionArea
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -13,33 +13,3 @@ index b1ae878f2cc..8a7540350ef 100644
|
||||
if (shouldShowCaret) {
|
||||
_scheduleShowCaretOnScreen(withAnimation: true);
|
||||
}
|
||||
@@ -5709,7 +5711,7 @@ class EditableTextState extends State<EditableText>
|
||||
PasteTextIntent: _makeOverridable(_PasteSelectionAction(this)),
|
||||
|
||||
TransposeCharactersIntent: _makeOverridable(_transposeCharactersAction),
|
||||
- EditableTextTapOutsideIntent: _makeOverridable(_EditableTextTapOutsideAction()),
|
||||
+ EditableTextTapOutsideIntent: _makeOverridable(_EditableTextTapOutsideAction(this)),
|
||||
EditableTextTapUpOutsideIntent: _makeOverridable(_EditableTextTapUpOutsideAction()),
|
||||
};
|
||||
|
||||
@@ -6775,10 +6777,19 @@ class _WebClipboardStatusNotifier extends ClipboardStatusNotifier {
|
||||
}
|
||||
|
||||
class _EditableTextTapOutsideAction extends ContextAction<EditableTextTapOutsideIntent> {
|
||||
- _EditableTextTapOutsideAction();
|
||||
+ _EditableTextTapOutsideAction(this.state);
|
||||
+
|
||||
+ final EditableTextState state;
|
||||
|
||||
@override
|
||||
void invoke(EditableTextTapOutsideIntent intent, [BuildContext? context]) {
|
||||
+ state.hideToolbar();
|
||||
+ final controller = state.widget.controller;
|
||||
+ final selection = controller.value.selection;
|
||||
+ if (!selection.isCollapsed) {
|
||||
+ controller.selection = TextSelection.collapsed(offset: selection.end);
|
||||
+ }
|
||||
+ return;
|
||||
// The focus dropping behavior is only present on desktop platforms.
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
|
||||
Reference in New Issue
Block a user