Hide keyboard and selection icons when Scribe mobile modal opened
When opening Scribe mobile modal, we now unfocus the composer to hide the keyboard and the selection start and end icons from the OS. Add new methods to save, restore, and clear text selection in HTML editor. These methods allow preserving and restoring user selection state when opening the Scribe mobile modal so that the "replace" action still works.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:scribe/scribe.dart';
|
||||
|
||||
@@ -7,7 +8,7 @@ class InlineAiAssistButton extends StatelessWidget {
|
||||
final ImagePaths imagePaths;
|
||||
final String? selectedText;
|
||||
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
||||
final VoidCallback? onTapFallback;
|
||||
final AsyncCallback? onTapFallback;
|
||||
|
||||
const InlineAiAssistButton({
|
||||
super.key,
|
||||
@@ -42,7 +43,7 @@ class InlineAiAssistButton extends StatelessWidget {
|
||||
size = renderBox.size;
|
||||
}
|
||||
|
||||
onTapFallback?.call();
|
||||
await onTapFallback?.call();
|
||||
|
||||
await AiScribeModalManager.showAIScribeMenuModal(
|
||||
imagePaths: imagePaths,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||
import 'package:scribe/scribe.dart';
|
||||
@@ -15,7 +16,7 @@ class AiSelectionOverlay extends StatelessWidget {
|
||||
final TextSelectionModel? selection;
|
||||
final ImagePaths imagePaths;
|
||||
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
||||
final VoidCallback? onTapFallback;
|
||||
final AsyncCallback? onTapFallback;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user