[Bug]: Unintended back navigation occurs when rapidly tapping the back button in `topicScreen`
Chưa có ai nhận issue này.
- #1572 của @YiBeomSeok — đã đóng, không merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu từ entry point topicScreen và kiểm tra callback onBackClick của nó cùng các phương thức listDetailNavigator mà nó sử dụng. Thay đổi được hoàn tất khi các lần chạm nút quay lại liên tiếp chỉ điều hướng khi canNavigateBack() cho phép; issue không nêu tên tệp kiểm thử nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
Is there a StackOverflow question about this issue?
- I have searched StackOverflow
What happened?
When rapidly tapping the back button in the topicScreen component, unintended back navigation occurs. The current implementation of the onBackClick directly calls listDetailNavigator.navigateBack() without first checking if navigation is allowed, leading to unexpected behavior.
I expected the back navigation to occur only when it is allowed, preventing any unintended navigation when the back button is tapped multiple times in quick succession. Specifically, the onBackClick should check listDetailNavigator.canNavigateBack() before calling navigateBack() to ensure that the back navigation is permitted.
topicScreen(
showBackButton = !listDetailNavigator.isListPaneVisible(),
onBackClick = {
if(listDetailNavigator.canNavigateBack()) {
listDetailNavigator.navigateBack()
}
},
onTopicClick = ::onTopicClickShowDetailPane,
)
In typical scenarios using a standard navController, this issue can be avoided by checking the lifecycle state of the navBackStackEntry before popping the back stack:
if (navController.currentBackStackEntry?.lifecycle?.currentState == Lifecycle.State.RESUMED) {
navController.popBackStack()
}
Relevant logcat output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Kotlin
- Star
- 22.1k
- Fork
- 4.7k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của android/nowinandroid
-
[Bug]: Search empty-state copy reads "explorer" instead of "explore"Có thể đã có người làm @Amir-yazdanmanesh đã nhận 168 ngày trước. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
android/nowinandroid#2127 ·
-
[Documentation]: Grammar error in SyncInitializer commentCó thể đã có người làm @sahilpatel2521 đã nhận 185 ngày trước. Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
android/nowinandroid#2121 ·
-
[FR]: Move TopicScreen user-facing strings to resourcesCó thể đã có người làm @ois0886 đã nhận 189 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
android/nowinandroid#2115 ·
-
[Bug]: Interests top-level nav label sources string from feature/search instead of feature/interestsCó thể đã có người làm @Noahs212 đã nhận 193 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
android/nowinandroid#2112 ·
-
[FR]: Add network connectivity check before launching Chrome Custom TabCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
android/nowinandroid#2110 ·
Tất cả issue của android/nowinandroid
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
emm3000/myGame#2175 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MetrolistGroup/Metrolist#5426 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
backend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
digitalfabrik/entitlementcard#3330 ·
Maintainer thường phản hồi trong vòng 2 ngày