Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63e5795

Browse files
Compute the index of the current task list item using only other task list items.
1 parentf6888ca commit63e5795

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/task-lists-element.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ function position(checkbox: HTMLInputElement): [number, number] {
132132
constlist=taskList(checkbox)
133133
if(!list)thrownewError('.contains-task-list not found')
134134
constitem=checkbox.closest('.task-list-item')
135-
constindex=item ?Array.from(list.children).indexOf(item) :-1
135+
constindex=item
136+
?Array.from(list.children)
137+
.filter(el=>el.classList.contains('task-list-item'))
138+
.indexOf(item)
139+
:-1
136140
return[listIndex(list),index]
137141
}
138142

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp