Skip to content

Commit fa204c4

Browse files
Fix iOS keyboard glitch when switching between topic and content inputs
Disable scribbleEnabled on both topic and content TextFields to prevent the keyboard from briefly sliding out and back in when switching focus between the two inputs on iOS. This is a workaround for an upstream Flutter bug in the iOS keyboard lifecycle management. The trade-off is that Apple Pencil Scribble handwriting input is disabled for these fields, which is acceptable since most users compose with the keyboard. Fixes: #1974
1 parent b26901f commit fa204c4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/widgets/compose_box.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ class _ContentInput extends StatelessWidget {
606606
minLines: 2,
607607
maxLines: null,
608608
textCapitalization: TextCapitalization.sentences,
609+
// Disable scribble to maintain keyboard continuity on iOS
610+
// when switching between topic and content inputs.
611+
// See: https://github.com/zulip/zulip-flutter/issues/1974
612+
scribbleEnabled: false,
609613
decoration: InputDecoration(
610614
// This padding ensures that the user can always scroll long
611615
// content entirely out of the top or bottom shadow if desired.
@@ -867,7 +871,11 @@ class _TopicInputState extends State<_TopicInput> {
867871
focusNode: widget.controller.topicFocusNode,
868872
textInputAction: TextInputAction.next,
869873
style: topicTextStyle,
870-
decoration: decoration)));
874+
decoration: decoration,
875+
// Disable scribble to maintain keyboard continuity on iOS
876+
// when switching between topic and content inputs.
877+
// See: https://github.com/zulip/zulip-flutter/issues/1974
878+
scribbleEnabled: false)));
871879
}
872880
}
873881

0 commit comments

Comments
 (0)