diff --git a/lib/components/input_bar.dart b/lib/components/input_bar.dart index ad1f40d..90e2cc2 100644 --- a/lib/components/input_bar.dart +++ b/lib/components/input_bar.dart @@ -16,6 +16,7 @@ class InputBar extends StatelessWidget { final TextEditingController controller; final InputDecoration decoration; final ValueChanged onChanged; + final bool autofocus; InputBar({ this.room, @@ -27,6 +28,7 @@ class InputBar extends StatelessWidget { this.controller, this.decoration, this.onChanged, + this.autofocus, }); List> getSuggestions(String text) { @@ -265,6 +267,7 @@ class InputBar extends StatelessWidget { minLines: minLines, maxLines: maxLines, keyboardType: keyboardType, + autofocus: autofocus, onSubmitted: (text) { // fix for library for now onSubmitted(text); diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 0dd0283..0f25fc4 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -961,7 +961,8 @@ class _ChatState extends State<_Chat> { room: room, minLines: 1, maxLines: kIsWeb ? 1 : 8, - keyboardType: kIsWeb + autofocus: !PlatformInfos.isMobile, + keyboardType: !PlatformInfos.isMobile ? TextInputType.text : TextInputType.multiline, onSubmitted: (String text) {