mirror of
https://github.com/obsqrbtz/goose-highlighter.git
synced 2026-04-08 20:19:06 +03:00
fix: correct matches list buttons handling
fix: pressing on the match list item triggers jump to the current match
This commit is contained in:
@@ -339,12 +339,17 @@ export class PopupController {
|
||||
const word = item.dataset.word;
|
||||
if (!word) return;
|
||||
|
||||
if (target.classList.contains('highlight-prev')) {
|
||||
const button = target.closest('button');
|
||||
|
||||
if (button?.classList.contains('highlight-prev')) {
|
||||
e.stopPropagation();
|
||||
await this.navigateHighlight(word, -1);
|
||||
} else if (target.classList.contains('highlight-next')) {
|
||||
} else if (button?.classList.contains('highlight-next')) {
|
||||
e.stopPropagation();
|
||||
await this.navigateHighlight(word, 1);
|
||||
} else {
|
||||
await this.jumpToHighlight(word, 0);
|
||||
} else if (!button) {
|
||||
const currentIndex = this.highlightIndices.get(word) || 0;
|
||||
await this.jumpToHighlight(word, currentIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user