diff --git a/app/src/main/java/org/koitharu/kotatsu/base/ui/widgets/SelectableTextView.kt b/app/src/main/java/org/koitharu/kotatsu/base/ui/widgets/SelectableTextView.kt
new file mode 100644
index 000000000..e931853f0
--- /dev/null
+++ b/app/src/main/java/org/koitharu/kotatsu/base/ui/widgets/SelectableTextView.kt
@@ -0,0 +1,29 @@
+package org.koitharu.kotatsu.base.ui.widgets
+
+import android.content.Context
+import android.text.Selection
+import android.text.Spannable
+import android.util.AttributeSet
+import android.view.MotionEvent
+import androidx.annotation.AttrRes
+import com.google.android.material.textview.MaterialTextView
+
+class SelectableTextView @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ @AttrRes defStyleAttr: Int = android.R.attr.textViewStyle,
+) : MaterialTextView(context, attrs, defStyleAttr) {
+
+ override fun dispatchTouchEvent(event: MotionEvent?): Boolean {
+ fixSelectionRange()
+ return super.dispatchTouchEvent(event)
+ }
+
+ // https://stackoverflow.com/questions/22810147/error-when-selecting-text-from-textview-java-lang-indexoutofboundsexception-se
+ private fun fixSelectionRange() {
+ if (selectionStart < 0 || selectionEnd < 0) {
+ val spannableText = text as? Spannable ?: return
+ Selection.setSelection(spannableText, text.length)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout-w600dp/fragment_details.xml b/app/src/main/res/layout-w600dp/fragment_details.xml
index e45f03909..5775a9790 100644
--- a/app/src/main/res/layout-w600dp/fragment_details.xml
+++ b/app/src/main/res/layout-w600dp/fragment_details.xml
@@ -217,7 +217,7 @@
app:layout_constraintTop_toBottomOf="@id/recyclerView_bookmarks"
tools:visibility="visible" />
-
-