Skip to content

Commit 50ae891

Browse files
committed
feat: improve hover behavior for download button
- Add functionality to clear hover overlay display timeout when hovering over the download button. - Enhance user experience by preventing unintended overlay display during interactions with the download button.
1 parent 6e2bfcf commit 50ae891

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/js/modules/event-handlers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ export class EventHandlers {
406406
const path = card.dataset.path;
407407
if (!path) return;
408408

409+
// 如果悬停在下载按钮上,清空进入悬浮展示层的计时
410+
const downloadButton = hoverTarget?.closest('.download-button');
411+
if (downloadButton) {
412+
if (this._hoverOverlayShowTimeout) {
413+
clearTimeout(this._hoverOverlayShowTimeout);
414+
this._hoverOverlayShowTimeout = null;
415+
}
416+
return;
417+
}
418+
409419
// Cancel any pending hide while moving between cards
410420
if (this._hoverOverlayHideTimeout) {
411421
clearTimeout(this._hoverOverlayHideTimeout);

0 commit comments

Comments
 (0)