Anxcye / Anxcye/anx-reader

[Bug]: 阅读界面选中文本后无法使用翻页键

Open
#966 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
8.8k
Forks
626
Avg merge
9d 22h
Merged PRs (30d)
1

Description

### Prerequisites|前提条件

- [x] I have checked the [troubleshooting](https://github.com/Anxcye/anx-reader/blob/develop/docs/troubleshooting.md)|我已经查看过[故障排除](https://github.com/Anxcye/anx-reader/blob/develop/docs/troubleshooting.md)
- [x] I have searched for similar issues and did not find any|我已经搜索过没有相同的问题

### Describe the bug|描述问题

当打开书籍进行阅读时,翻页按钮(在windows上是方向键,在手机上是电源加减键)可以正常翻页。
但选中文章文本后,翻页按钮在当前代码版本会无法翻页,而是变为将界面左右平移,且无法跳转至下一章。在打开上下菜单之后功能会自动恢复。
经过对各个发布版本的测试,确认版本为1.9.2时的问题为进行文本选中后翻页按钮无法工作,而在版本为v1.10.0-beta.1时则已经变为了前文的平移状况。

### To reproduce|重现步骤

1. 启用翻页键功能
2. 前往阅读界面
3. 选中书籍文本
4. 按下翻页键后,页面出现故障

### Expected behavior|预期行为

在进行上述动作后,翻页键应能正常工作

### Screenshots|截图

_No response_

### Platform (please complete the following information)|平台(请填写以下信息)

- Platform: | 平台:All Platform
- AnxReader Version: | 安读版本:1.14.0+6321

### Additional context|其他信息

目前通过GLM-5.2审查,确定故障原因如下:
- 阅读页用 Focus + _readerFocusNode + reading_page.dart:197-200处理硬件翻页键,首行守卫 if (!_readerFocusNode.hasFocus) return ignored。
- 在 InAppWebView 选中文本时 WebView 抢占焦点,_readerFocusNode 失焦;选择清除/菜单关闭后无人归还焦点,按键命中守卫返回 ignored → 穿透到 WebView 被 #container(overflow-x: auto)原生滚动消费(平移),#turnPage 跳章逻辑永不执行(无法跳章)。
- "打开上下菜单即恢复"的原因是 hideBottomBar() (reading_page.dart#L326-L335末尾)的 _requestReaderFocus() 实现重新获焦所致。
- 症状差异因1.9.2把 #handleScrollBoundaries() 注释掉:启用时穿透按键触发可见平移;注释后平移无可见效果,故表现为"完全无效"。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.