Changeset 06f3791 in Klonkt


Ignore:
Timestamp:
06/19/2026 11:42:39 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
a0bff44
Parents:
d2078f4
Message:

fix(editor): toolbar stays in view in fullscreen on mobile (visual viewport)

When the mobile keyboard opened, the position:fixed fullscreen frame
(attached to the layout viewport) slid up → toolbar off screen. The
frame now follows the visualViewport (top + height) while fullscreen is
active, so the formatting toolbar always remains visible above the
keyboard.

Co-Authored-By: Claude <noreply@…>

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG.md

    rd2078f4 r06f3791  
    2525### Toegevoegd
    2626- Schrijfvenster kan op **volledig scherm** (knop in de editor-toolbar, of Escape om
    27   terug te gaan) — fijn voor afleidingsvrij schrijven op mobiel.
     27  terug te gaan) — fijn voor afleidingsvrij schrijven op mobiel. De opmaak-toolbar
     28  blijft daarbij altijd bovenaan in beeld, ook als het mobiele toetsenbord opent
     29  (frame volgt de visual viewport).
    2830- Beheerder kan z'n **Google-account koppelen** (Account → Inloggen met Google) en
    2931  daarna óók met Google inloggen. Veilig: koppelen kan alleen terwijl je met
  • src/views/pages/post-edit.ejs

    rd2078f4 r06f3791  
    11601160  const fsBtn = document.getElementById('pe-fullscreen-btn');
    11611161  const editorFrame = document.querySelector('.pe-editor-frame');
     1162
     1163  // Op mobiel duwt het toetsenbord de zichtbare (visual) viewport omhoog terwijl
     1164  // een position:fixed-frame aan de LAYOUT-viewport blijft hangen → de toolbar
     1165  // schuift uit beeld. Houd het fullscreen-frame daarom gelijk aan de visual
     1166  // viewport (top + hoogte), zodat de toolbar altijd bovenaan zichtbaar blijft.
     1167  function syncFsViewport() {
     1168    if (!editorFrame || !editorFrame.classList.contains('pe-fs')) return;
     1169    const vv = window.visualViewport;
     1170    if (!vv) return;
     1171    editorFrame.style.top = vv.offsetTop + 'px';
     1172    editorFrame.style.height = vv.height + 'px';
     1173  }
     1174  function clearFsViewport() {
     1175    if (!editorFrame) return;
     1176    editorFrame.style.top = '';
     1177    editorFrame.style.height = '';
     1178  }
    11621179  function toggleFullscreen() {
    11631180    if (!editorFrame) return;
     
    11671184      fsBtn.setAttribute('aria-pressed', on ? 'true' : 'false');
    11681185      fsBtn.title = on ? 'Verklein' : 'Volledig scherm';
     1186    }
     1187    if (window.visualViewport) {
     1188      if (on) {
     1189        window.visualViewport.addEventListener('resize', syncFsViewport);
     1190        window.visualViewport.addEventListener('scroll', syncFsViewport);
     1191        syncFsViewport();
     1192      } else {
     1193        window.visualViewport.removeEventListener('resize', syncFsViewport);
     1194        window.visualViewport.removeEventListener('scroll', syncFsViewport);
     1195        clearFsViewport();
     1196      }
    11691197    }
    11701198    if (on) editor.focus({ preventScroll: true });
Note: See TracChangeset for help on using the changeset viewer.