Skip to content

Commit e42d495

Browse files
authored
Fix broken EPUB selection in paginated mode (readium#502)
1 parent 3abdb8c commit e42d495

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ All notable changes to this project will be documented in this file. Take a look
1212

1313
* All the `completion` parameters of the `Navigator` APIs are removed.
1414

15+
### Fixed
16+
17+
#### Navigator
18+
19+
* [#325](https://github.com/readium/kotlin-toolkit/issues/325) Top EPUB selections no longer break when dragging the selection handles.
20+
1521

1622
## [3.0.0-alpha.2]
1723

readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ internal open class R2BasicWebView(context: Context, attrs: AttributeSet) : WebV
186186
}
187187

188188
override fun onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean) {
189+
// Workaround addressing a bug in the Android WebView where the viewport is scrolled while
190+
// dragging the text selection handles.
191+
// See https://github.com/readium/kotlin-toolkit/issues/325
192+
if (isSelecting) {
193+
return
194+
}
195+
189196
if (callback != null) {
190197
callback?.onOverScrolled(scrollX, scrollY, clampedX, clampedY)
191198
}

0 commit comments

Comments
 (0)