hotfix(ai-scribe): fix Safari keyboard input issue in AI Scribe search bar dialog
This commit is contained in:
+3
@@ -101,6 +101,9 @@ extension HandleAiScribeInComposerExtension on ComposerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> openAIAssistantModal(Offset? position, Size? size) async {
|
Future<void> openAIAssistantModal(Offset? position, Size? size) async {
|
||||||
|
clearFocusRecipients();
|
||||||
|
clearFocusSubject();
|
||||||
|
|
||||||
final fullText = await _getTextOnlyContentInEditor();
|
final fullText = await _getTextOnlyContentInEditor();
|
||||||
|
|
||||||
await AiScribeModalManager.showAIScribeMenuModal(
|
await AiScribeModalManager.showAIScribeMenuModal(
|
||||||
|
|||||||
+6
@@ -24,7 +24,13 @@ class ComposerAiScribeSelectionOverlay extends StatelessWidget {
|
|||||||
imagePaths: controller.imagePaths,
|
imagePaths: controller.imagePaths,
|
||||||
onSelectAiScribeSuggestionAction:
|
onSelectAiScribeSuggestionAction:
|
||||||
controller.handleAiScribeSuggestionAction,
|
controller.handleAiScribeSuggestionAction,
|
||||||
|
onTapFallback: _clearComposerInputFocus,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _clearComposerInputFocus() {
|
||||||
|
controller.clearFocusRecipients();
|
||||||
|
controller.clearFocusSubject();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ class InlineAiAssistButton extends StatelessWidget {
|
|||||||
final ImagePaths imagePaths;
|
final ImagePaths imagePaths;
|
||||||
final String? selectedText;
|
final String? selectedText;
|
||||||
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
||||||
|
final VoidCallback? onTapFallback;
|
||||||
|
|
||||||
const InlineAiAssistButton({
|
const InlineAiAssistButton({
|
||||||
super.key,
|
super.key,
|
||||||
required this.imagePaths,
|
required this.imagePaths,
|
||||||
required this.onSelectAiScribeSuggestionAction,
|
required this.onSelectAiScribeSuggestionAction,
|
||||||
this.selectedText,
|
this.selectedText,
|
||||||
|
this.onTapFallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -40,6 +42,8 @@ class InlineAiAssistButton extends StatelessWidget {
|
|||||||
size = renderBox.size;
|
size = renderBox.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onTapFallback?.call();
|
||||||
|
|
||||||
await AiScribeModalManager.showAIScribeMenuModal(
|
await AiScribeModalManager.showAIScribeMenuModal(
|
||||||
imagePaths: imagePaths,
|
imagePaths: imagePaths,
|
||||||
availableCategories: AIScribeMenuCategory.values,
|
availableCategories: AIScribeMenuCategory.values,
|
||||||
|
|||||||
@@ -9,11 +9,13 @@ class AiSelectionOverlay extends StatelessWidget {
|
|||||||
required this.selection,
|
required this.selection,
|
||||||
required this.imagePaths,
|
required this.imagePaths,
|
||||||
required this.onSelectAiScribeSuggestionAction,
|
required this.onSelectAiScribeSuggestionAction,
|
||||||
|
this.onTapFallback,
|
||||||
});
|
});
|
||||||
|
|
||||||
final TextSelectionModel? selection;
|
final TextSelectionModel? selection;
|
||||||
final ImagePaths imagePaths;
|
final ImagePaths imagePaths;
|
||||||
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
final OnSelectAiScribeSuggestionAction onSelectAiScribeSuggestionAction;
|
||||||
|
final VoidCallback? onTapFallback;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -34,6 +36,7 @@ class AiSelectionOverlay extends StatelessWidget {
|
|||||||
imagePaths: imagePaths,
|
imagePaths: imagePaths,
|
||||||
selectedText: selectedText,
|
selectedText: selectedText,
|
||||||
onSelectAiScribeSuggestionAction: onSelectAiScribeSuggestionAction,
|
onSelectAiScribeSuggestionAction: onSelectAiScribeSuggestionAction,
|
||||||
|
onTapFallback: onTapFallback,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -71,22 +71,26 @@ class _AIScribeBarState extends State<AIScribeBar> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: KeyboardListener(
|
child: GestureDetector(
|
||||||
focusNode: _focusNode,
|
behavior: HitTestBehavior.translucent,
|
||||||
onKeyEvent: _handleKeyboardEvent,
|
onTap: _focusNode.requestFocus,
|
||||||
child: TextField(
|
child: KeyboardListener(
|
||||||
controller: _controller,
|
focusNode: _focusNode,
|
||||||
decoration: InputDecoration(
|
onKeyEvent: _handleKeyboardEvent,
|
||||||
hintText: ScribeLocalizations.of(context).inputPlaceholder,
|
child: TextField(
|
||||||
hintStyle: AIScribeTextStyles.searchBarHint,
|
controller: _controller,
|
||||||
border: InputBorder.none,
|
decoration: InputDecoration(
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
hintText: ScribeLocalizations.of(context).inputPlaceholder,
|
||||||
isDense: true,
|
hintStyle: AIScribeTextStyles.searchBarHint,
|
||||||
|
border: InputBorder.none,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||||
|
isDense: true,
|
||||||
|
),
|
||||||
|
style: AIScribeTextStyles.searchBar,
|
||||||
|
maxLines: null,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
cursorHeight: 16,
|
||||||
),
|
),
|
||||||
style: AIScribeTextStyles.searchBar,
|
|
||||||
maxLines: null,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
cursorHeight: 16,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user