Fixes #1755 Keyboard still open after creating comment#1825
Merged
dessalines merged 3 commits intoLemmyNet:mainfrom May 13, 2025
Merged
Fixes #1755 Keyboard still open after creating comment#1825dessalines merged 3 commits intoLemmyNet:mainfrom
dessalines merged 3 commits intoLemmyNet:mainfrom
Conversation
There was a problem hiding this comment.
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) {
dessalines
approved these changes
May 13, 2025
Member
dessalines
left a comment
There was a problem hiding this comment.
Weird bug, I haven't gotten it on several devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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