Skip to content

Fixes #1755 Keyboard still open after creating comment#1825

Merged
dessalines merged 3 commits intoLemmyNet:mainfrom
MV-GH:bug/1755
May 13, 2025
Merged

Fixes #1755 Keyboard still open after creating comment#1825
dessalines merged 3 commits intoLemmyNet:mainfrom
MV-GH:bug/1755

Conversation

@MV-GH
Copy link
Copy Markdown
Collaborator

@MV-GH MV-GH commented May 11, 2025

When sending the comment, it goes into "loading" mode, here the CommentReplyView leaves the composition, then when it receives response it goes into ApiState Success. Now the previous ReplyView enters composition again for short period. Where it asks for focus again. Thus the open keyboard state after creating a comment.

This fixes it by not showing the CommentReply view after sending. Thus it doesnt ask for focus.

Also removed the focus removal. It doesn't seem to do anything.

iCnpS6aRXf.mp4

The other screens aren't affected because they don't show a loading bar and hide the body. Thus it doesn't leave composition. :)

Fixes #1755

@MV-GH MV-GH requested a review from dessalines as a code owner May 11, 2025 21:43
@MV-GH MV-GH requested review from Copilot and removed request for dessalines May 11, 2025 21:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the keyboard remains visible after creating a comment by suppressing the re-entry of the CommentReply view and removing unnecessary focus removal calls.

  • Modified the loading state to include ApiState.Success to maintain the loading UI briefly.
  • Removed focus management code from multiple components and view models.
  • Updated a DisposableEffect to LaunchedEffect for immediate focus handling in the MarkdownTextField.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/src/main/java/com/jerboa/ui/components/privatemessage/PrivateMessageReplyScreen.kt Removed focus management and updated loading state logic.
app/src/main/java/com/jerboa/ui/components/common/InputFields.kt Replaced DisposableEffect with LaunchedEffect for focus request.
app/src/main/java/com/jerboa/ui/components/comment/reply/CommentReplyScreen.kt Removed focus manager parameter and adjusted loading state documentation.
app/src/main/java/com/jerboa/model/PrivateMessageReplyViewModel.kt Removed unnecessary focus management call after message creation.
app/src/main/java/com/jerboa/model/CommentReplyViewModel.kt Eliminated focus manager usage on comment success.
Comments suppressed due to low confidence (1)

app/src/main/java/com/jerboa/ui/components/common/InputFields.kt:165

  • Ensure that replacing DisposableEffect with LaunchedEffect preserves the intended lifecycle behavior, especially concerning cleanup logic if needed in future changes.
LaunchedEffect(Unit) {

@MV-GH MV-GH requested a review from dessalines May 11, 2025 21:51
Copy link
Copy Markdown
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird bug, I haven't gotten it on several devices.

@dessalines dessalines merged commit 75049f6 into LemmyNet:main May 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

virtual keyboard not closed after comment post

3 participants