todo: Fix bug preventing toggling todos with content in composebox.

Uptil now, with the composebox expanded and some content in it, when a
task in a todo widget was clicked, it did not toggle as expected but
focused the composebox, selecting all the text in it.

This is fixed by ensuring the task is a clickable message element and
clicking it doesn't collapse the composebox. This has the added benefit
of fixing the bug where toggling a task expanded a collapsed composebox.

Fixes: #22928.
This commit is contained in:
N-Shar-ma 2023-01-05 14:44:06 +05:30 committed by Tim Abbott
parent a1151aef8b
commit 88603bd34b
1 changed files with 9 additions and 0 deletions

View File

@ -149,6 +149,14 @@ export function initialize() {
return true;
}
// Allow toggling of tasks in todo widget
if (
$target.is(".todo-widget label.checkbox") ||
$target.parents(".todo-widget label.checkbox").length > 0
) {
return true;
}
return false;
}
@ -1000,6 +1008,7 @@ export function initialize() {
// filters or search widgets won't unnecessarily close
// compose.
!$(e.target).closest("input").length &&
!$(e.target).closest(".todo-widget label.checkbox").length &&
!$(e.target).closest("textarea").length &&
!$(e.target).closest("select").length &&
// Clicks inside an overlay, popover, custom