choreographer pulls roomID from chat so input bar key does not change after setting choreo roomID, resolving issues with input bar auto-focus

pull/1384/head
ggurdin 1 year ago
parent 8e56f9c3ab
commit 7165060041
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -328,7 +328,6 @@ class ChatController extends State<ChatPageWithRoom>
);
}
await Matrix.of(context).client.roomsLoading;
choreographer.setRoomId(roomId);
});
// Pangea#
_tryLoadTimeline();

@ -463,7 +463,7 @@ class InputBar extends StatelessWidget {
debounceDuration: const Duration(milliseconds: 50),
// show suggestions after 50ms idle time (default is 300)
// #Pangea
key: controller!.choreographer.inputLayerLinkAndKey.key,
key: controller?.choreographer.inputLayerLinkAndKey.key,
// builder: (context, controller, focusNode) => TextField(
builder: (context, _, focusNode) => TextField(
// Pangea#
@ -504,11 +504,11 @@ class InputBar extends StatelessWidget {
onSubmitted!(text);
},
// #Pangea
style: controller?.isMaxLength ?? false
style: controller?.exceededMaxLength ?? false
? const TextStyle(color: Colors.red)
: null,
onTap: () {
controller!.onInputTap(
controller?.onInputTap(
context,
fNode: focusNode,
);

@ -42,7 +42,6 @@ class Choreographer {
bool isFetching = false;
Timer? debounceTimer;
String? _roomId;
ChoreoRecord choreoRecord = ChoreoRecord.newRecord;
// last checked by IGC or translation
String? _lastChecked;
@ -464,10 +463,7 @@ class Choreographer {
setState();
}
get roomId => _roomId;
void setRoomId(String? roomId) {
_roomId = roomId ?? '';
}
get roomId => chatController.roomId;
bool get _useCustomInput => [
EditType.keyboard,

@ -27,7 +27,7 @@ class PangeaTextController extends TextEditingController {
}
static const int maxLength = 1000;
bool get isMaxLength => text.length == 1000;
bool get exceededMaxLength => text.length >= maxLength;
bool forceKeepOpen = false;

Loading…
Cancel
Save