chore: Fix textfield focus
This commit is contained in:
parent
9f2b1a8d39
commit
e15ba4f6bc
2 changed files with 4 additions and 4 deletions
|
|
@ -43,10 +43,11 @@ class StoryPageController extends State<StoryPage> {
|
||||||
Event? get currentEvent => index < events.length ? events[index] : null;
|
Event? get currentEvent => index < events.length ? events[index] : null;
|
||||||
|
|
||||||
bool replyLoading = false;
|
bool replyLoading = false;
|
||||||
|
bool _emojiSelector = false;
|
||||||
|
|
||||||
void replyEmojiAction() async {
|
void replyEmojiAction() async {
|
||||||
if (replyLoading) return;
|
if (replyLoading) return;
|
||||||
hold();
|
_emojiSelector = true;
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => EmojiPicker(
|
builder: (context) => EmojiPicker(
|
||||||
|
|
@ -56,7 +57,7 @@ class StoryPageController extends State<StoryPage> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
unhold();
|
_emojiSelector = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void replyAction([String? message]) async {
|
void replyAction([String? message]) async {
|
||||||
|
|
@ -144,6 +145,7 @@ class StoryPageController extends State<StoryPage> {
|
||||||
_progressTimer?.cancel();
|
_progressTimer?.cancel();
|
||||||
if (reset) progress = Duration.zero;
|
if (reset) progress = Duration.zero;
|
||||||
_progressTimer = Timer.periodic(_step, (_) {
|
_progressTimer = Timer.periodic(_step, (_) {
|
||||||
|
if (replyFocus.hasFocus || _emojiSelector) return;
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
_progressTimer?.cancel();
|
_progressTimer?.cancel();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,6 @@ class StoryView extends StatelessWidget {
|
||||||
opacity: controller.isHold ? 0 : 1,
|
opacity: controller.isHold ? 0 : 1,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
onTap: controller.hold,
|
|
||||||
onEditingComplete: controller.unhold,
|
|
||||||
focusNode: controller.replyFocus,
|
focusNode: controller.replyFocus,
|
||||||
controller: controller.replyController,
|
controller: controller.replyController,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue