feat(ai-scribe): Fix click on response text of AI, dialog to be disappeared
This commit is contained in:
@@ -67,7 +67,6 @@ class AiScribeModalManager {
|
|||||||
crossAxisAlignment: crossAxisAlignment,
|
crossAxisAlignment: crossAxisAlignment,
|
||||||
onSelectAiScribeSuggestionAction: onSelectAiScribeSuggestionAction,
|
onSelectAiScribeSuggestionAction: onSelectAiScribeSuggestionAction,
|
||||||
),
|
),
|
||||||
barrierDismissible: false,
|
|
||||||
barrierColor: AIScribeColors.dialogBarrier,
|
barrierColor: AIScribeColors.dialogBarrier,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,34 +39,36 @@ class AiScribeModalWidget extends StatelessWidget {
|
|||||||
))
|
))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
final dialogContent = Column(
|
final dialogContent = PointerInterceptor(
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
spacing: AIScribeSizes.fieldSpacing,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
spacing: AIScribeSizes.fieldSpacing,
|
||||||
if (hasContent)
|
children: [
|
||||||
Flexible(
|
if (hasContent)
|
||||||
child: AiScribeContextMenu(
|
Flexible(
|
||||||
imagePaths: imagePaths,
|
child: AiScribeContextMenu(
|
||||||
menuActions: menuActions,
|
imagePaths: imagePaths,
|
||||||
submenuController: submenuController,
|
menuActions: menuActions,
|
||||||
onActionSelected: (menuAction) => _onActionSelected(
|
submenuController: submenuController,
|
||||||
context,
|
onActionSelected: (menuAction) => _onActionSelected(
|
||||||
menuAction,
|
context,
|
||||||
|
menuAction,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
MouseRegion(
|
||||||
|
onEnter: (_) => submenuController?.hide(),
|
||||||
|
child: AIScribeBar(
|
||||||
|
imagePaths: imagePaths,
|
||||||
|
onCustomPrompt: (customPrompt) {
|
||||||
|
Navigator.of(context).pop(CustomPromptAction(customPrompt));
|
||||||
|
submenuController?.hide();
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
MouseRegion(
|
],
|
||||||
onEnter: (_) => submenuController?.hide(),
|
),
|
||||||
child: AIScribeBar(
|
|
||||||
imagePaths: imagePaths,
|
|
||||||
onCustomPrompt: (customPrompt) {
|
|
||||||
Navigator.of(context).pop(CustomPromptAction(customPrompt));
|
|
||||||
submenuController?.hide();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (buttonPosition != null && buttonSize != null) {
|
if (buttonPosition != null && buttonSize != null) {
|
||||||
@@ -102,18 +104,20 @@ class AiScribeModalWidget extends StatelessWidget {
|
|||||||
: position.dy;
|
: position.dy;
|
||||||
|
|
||||||
return PointerInterceptor(
|
return PointerInterceptor(
|
||||||
child: GestureDetector(
|
child: Stack(
|
||||||
behavior: HitTestBehavior.opaque,
|
children: [
|
||||||
onTap: Navigator.of(context).pop,
|
Positioned.fill(
|
||||||
child: Stack(
|
child: GestureDetector(
|
||||||
children: [
|
behavior: HitTestBehavior.translucent,
|
||||||
PositionedDirectional(
|
onTap: Navigator.of(context).pop,
|
||||||
start: position.dx,
|
|
||||||
top: top,
|
|
||||||
child: dialogContent,
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
PositionedDirectional(
|
||||||
|
start: position.dx,
|
||||||
|
top: top,
|
||||||
|
child: dialogContent,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,23 +109,25 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return PointerInterceptor(
|
return PointerInterceptor(
|
||||||
child: GestureDetector(
|
child: Stack(
|
||||||
behavior: HitTestBehavior.opaque,
|
children: [
|
||||||
onTap: _handleClickOutside,
|
Positioned.fill(
|
||||||
child: Stack(
|
child: GestureDetector(
|
||||||
children: [
|
behavior: HitTestBehavior.translucent,
|
||||||
PositionedDirectional(
|
onTap: _handleClickOutside,
|
||||||
start: layout.offset.dx,
|
|
||||||
top: layout.top,
|
|
||||||
bottom: layout.bottom,
|
|
||||||
child: _buildModalContainer(
|
|
||||||
width: modalWidth,
|
|
||||||
maxHeight: layout.availableHeight,
|
|
||||||
child: dialogContent,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
PositionedDirectional(
|
||||||
|
start: layout.offset.dx,
|
||||||
|
top: layout.top,
|
||||||
|
bottom: layout.bottom,
|
||||||
|
child: _buildModalContainer(
|
||||||
|
width: modalWidth,
|
||||||
|
maxHeight: layout.availableHeight,
|
||||||
|
child: dialogContent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -177,21 +179,23 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget> {
|
|||||||
required double maxHeight,
|
required double maxHeight,
|
||||||
required Widget child,
|
required Widget child,
|
||||||
}) {
|
}) {
|
||||||
return Container(
|
return PointerInterceptor(
|
||||||
width: width,
|
child: Container(
|
||||||
constraints: BoxConstraints(
|
width: width,
|
||||||
minHeight: AIScribeSizes.suggestionModalMinHeight,
|
constraints: BoxConstraints(
|
||||||
maxHeight: maxHeight,
|
minHeight: AIScribeSizes.suggestionModalMinHeight,
|
||||||
),
|
maxHeight: maxHeight,
|
||||||
padding: AIScribeSizes.suggestionContentPadding,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AIScribeColors.background,
|
|
||||||
borderRadius: BorderRadius.circular(
|
|
||||||
AIScribeSizes.menuRadius,
|
|
||||||
),
|
),
|
||||||
boxShadow: AIScribeShadows.modal,
|
padding: AIScribeSizes.suggestionContentPadding,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AIScribeColors.background,
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
AIScribeSizes.menuRadius,
|
||||||
|
),
|
||||||
|
boxShadow: AIScribeShadows.modal,
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
),
|
),
|
||||||
child: child,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user