Close keyboard if open
This commit is contained in:
parent
43d99c526a
commit
ea8e4497f3
3 changed files with 16 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pages/chat/chat.dart';
|
||||
import 'package:fluffychat/pangea/matrix_event_wrappers/pangea_message_event.dart';
|
||||
import 'package:fluffychat/pangea/utils/any_state_holder.dart';
|
||||
|
|
@ -57,7 +58,7 @@ class MessageSelectionOverlay extends StatelessWidget {
|
|||
if (targetRenderBox != null) {
|
||||
final Size transformTargetSize = (targetRenderBox as RenderBox).size;
|
||||
final Offset targetOffset = (targetRenderBox).localToGlobal(Offset.zero);
|
||||
left = targetOffset.dx;
|
||||
left = targetOffset.dx - (FluffyThemes.isColumnMode(context) ? 424 : 0);
|
||||
showDown = targetOffset.dy + transformTargetSize.height <=
|
||||
headerSize + stackSize / 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,10 @@ class ToolbarDisplayController {
|
|||
|
||||
void showToolbar(BuildContext context, {MessageMode? mode}) {
|
||||
// Close keyboard, if open
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (controller.inputFocus.hasFocus) {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
return;
|
||||
}
|
||||
// Close emoji picker, if open
|
||||
controller.showEmojiPicker = false;
|
||||
if (highlighted) return;
|
||||
|
|
@ -334,7 +337,11 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double maxHeight = (MediaQuery.of(context).size.height -
|
||||
(PlatformInfos.isIOS ? 256 : 198)) /
|
||||
(PlatformInfos.isWeb
|
||||
? 211
|
||||
: PlatformInfos.isIOS
|
||||
? 256
|
||||
: 198)) /
|
||||
2 +
|
||||
30;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,11 @@ class OverlayMessage extends StatelessWidget {
|
|||
);
|
||||
|
||||
final double maxHeight = (MediaQuery.of(context).size.height -
|
||||
(PlatformInfos.isIOS ? 256 : 198)) /
|
||||
(PlatformInfos.isWeb
|
||||
? 225
|
||||
: PlatformInfos.isIOS
|
||||
? 256
|
||||
: 198)) /
|
||||
2 -
|
||||
30;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue