Skip to content

Commit f5c09f3

Browse files
committed
fine tune
1 parent a1b5c51 commit f5c09f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

web_src/js/modules/fomantic/dropdown.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ test('hideScopedEmptyDividers-simple', () => {
1515
expect(container.innerHTML).toEqual(`
1616
<div class="divider hidden transition"></div>
1717
<div class="item">a</div>
18-
<div class="divider"></div>
1918
<div class="divider hidden transition"></div>
2019
<div class="divider hidden transition"></div>
20+
<div class="divider"></div>
2121
<div class="item">b</div>
2222
<div class="divider hidden transition"></div>
2323
`);
@@ -35,10 +35,10 @@ test('hideScopedEmptyDividers-items-all-filtered', () => {
3535
hideScopedEmptyDividers(container);
3636
expect(container.innerHTML).toEqual(`
3737
<div class="any"></div>
38-
<div class="divider"></div>
38+
<div class="divider hidden transition"></div>
3939
<div class="item filtered">a</div>
4040
<div class="item filtered">b</div>
41-
<div class="divider hidden transition"></div>
41+
<div class="divider"></div>
4242
<div class="any"></div>
4343
`);
4444
});

web_src/js/modules/fomantic/dropdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export function hideScopedEmptyDividers(container: Element) {
341341
// no need to update "visibleItems" array since this is the last loop
342342
for (let i = 0; i < visibleItems.length - 1; i++) {
343343
if (!visibleItems[i].matches('.divider')) continue;
344-
if (visibleItems[i + 1].matches('.divider')) hideDivider(visibleItems[i + 1]);
344+
if (visibleItems[i + 1].matches('.divider')) hideDivider(visibleItems[i]);
345345
}
346346
}
347347

0 commit comments

Comments
 (0)