Skip to content

Commit 59b2013

Browse files
committed
Remove fixed-depth x-coordinate gate for task list taps
The previous check rejected taps beyond a single leading margin width, preventing interaction with indented checkboxes. The handler now performs its own nesting-aware check, so the outer gate only needs to verify the editor is enabled.
1 parent a4bcfd5 commit 59b2013

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -751,16 +751,11 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
751751
x += scrollX
752752
y += scrollY
753753

754-
// We check whether the user tap on a checkbox of a task list. The aztec text field should be enabled and we
755-
// check whether the tap event was on the leading margin which is where the checkbox is located plus a padding
756-
// space used to increase the target size for the tap event.
757-
if (isEnabled &&
758-
x + totalPaddingStart <= (blockFormatter.listStyleLeadingMargin() + AztecTaskListSpan.PADDING_SPACE)) {
754+
// We check whether the user tap on a checkbox of a task list. The handler performs its
755+
// own nesting-aware x-coordinate check, so we only need a rough gate here.
756+
if (isEnabled) {
759757
val line = layout.getLineForVertical(y)
760758
val off = layout.getOffsetForHorizontal(line, x.toFloat())
761-
// If the tap event was on the leading margin, we double check whether we are tapping on a task list item.
762-
// If that is true, then we return false because we don't want to propagate the tap event to stop moving
763-
// the cursor to the item tapped.
764759
if (getTaskListHandler()?.handleTaskListClick(
765760
text,
766761
off,

0 commit comments

Comments
 (0)