From b71e2a83a04b580e4301f2a27e19a086094beb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Yak=C4=B1=C5=9Ft=C4=B1r?= Date: Sat, 29 Aug 2026 23:09:14 +0300 Subject: [PATCH] fix(modal): fix close button display none override and prettier format v1.3.3 --- client.js | 23 ++++++++++++++++++----- package.json | 2 +- style.css | 9 +++++++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/client.js b/client.js index b5cd77b..52a7cd0 100644 --- a/client.js +++ b/client.js @@ -1406,7 +1406,8 @@ // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- - // 8. FULL YOUTUBE SEARCH & VOICE MODAL ENGINE (v1.3.2 - Clean Generic Labels) + // -------------------------------------------------------------------------- + // 8. FULL YOUTUBE SEARCH & VOICE MODAL ENGINE (v1.3.3 - Guaranteed Close Fix) // -------------------------------------------------------------------------- var activeVoiceRec = null; var isVoiceListening = false; @@ -1421,7 +1422,6 @@ modal.setAttribute('role', 'dialog'); modal.setAttribute('aria-modal', 'true'); modal.setAttribute('aria-labelledby', 'yaktube-modal-search-title'); - modal.style.display = 'none'; modal.innerHTML = '
' + @@ -1484,7 +1484,9 @@ }); // Close on Back button or Escape - backBtn.addEventListener('click', function () { + backBtn.addEventListener('click', function (e) { + e.preventDefault(); + e.stopPropagation(); closeFullSearchModal(); }); @@ -1540,6 +1542,7 @@ function openFullSearchModal(initialQuery, autoStartVoice) { var modal = createFullSearchModal(); + modal.classList.add('yaktube-modal-open'); modal.style.display = 'flex'; var inp = modal.querySelector('#yaktube-modal-input'); @@ -1562,9 +1565,19 @@ function closeFullSearchModal() { var modal = document.getElementById('yaktube-full-search-modal'); - if (modal) modal.style.display = 'none'; + if (modal) { + modal.classList.remove('yaktube-modal-open'); + modal.style.display = 'none'; + } stopVoiceInsideModal(); announce('Arama penceresi kapatıldı.'); + + var trigger = document.querySelector('.yaktube-search-trigger-pill'); + if (trigger) { + try { + trigger.focus(); + } catch (e) {} + } } function toggleVoiceInsideModal() { @@ -1763,7 +1776,7 @@ // Escape: Close Full Search Modal else if (e.key === 'Escape' || e.keyCode === 27) { var modal = document.getElementById('yaktube-full-search-modal'); - if (modal && modal.style.display === 'flex') { + if (modal && modal.classList.contains('yaktube-modal-open')) { e.preventDefault(); closeFullSearchModal(); } diff --git a/package.json b/package.json index 0dee228..d2f199b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-yaktube-ondemand", - "version": "1.3.2", + "version": "1.3.3", "description": "Accessible On-Demand YouTube Import, Live Streams, Smart Recommendations and A11y Engine for PeerTube", "main": "main.js", "clientScripts": [ diff --git a/style.css b/style.css index 3e8b088..b9c51c3 100644 --- a/style.css +++ b/style.css @@ -412,7 +412,8 @@ my-header .action-buttons { /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -/* YOUTUBE FULL SEARCH & VOICE MODAL (v1.3.1 - Sleek Trigger Pill) */ +/* -------------------------------------------------------------------------- */ +/* YOUTUBE FULL SEARCH & VOICE MODAL (v1.3.3 - Display Fix) */ /* -------------------------------------------------------------------------- */ /* Header Search Trigger Container */ @@ -522,11 +523,15 @@ my-search-typeahead, background: rgba(0, 0, 0, 0.82) !important; backdrop-filter: blur(12px) !important; z-index: 999999 !important; - display: flex !important; + display: none; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; padding-top: 40px !important; +} + +.yaktube-full-search-modal.yaktube-modal-open { + display: flex !important; animation: yaktube-fade-in 0.2s ease-out !important; }