Changeset 408afc1 in Klonkt


Ignore:
Timestamp:
06/19/2026 11:56:37 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
5f7dba2
Parents:
4ad669a
Message:

fix(editor): Save/Cancel bar above the keyboard on mobile

The sticky-bottom action bar ended up behind the mobile keyboard →
buttons off screen. When body.kb-open the bar is now fixed and its top
is positioned just above the keyboard via the visual viewport, so Save/
Cancel remain reachable while typing.

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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG.md

    r4ad669a r408afc1  
    1515
    1616### Opgelost
     17- Post-editor op mobiel: de Opslaan/Annuleren-balk viel achter het toetsenbord
     18  (sticky-bottom). De balk zweeft nu mee bóven het toetsenbord (positie via de
     19  visual viewport), dus de knoppen blijven bereikbaar tijdens het typen.
    1720- Mobiel toetsenbord vs. layout (site-breed): zodra het toetsenbord opent tijdens
    1821  het typen, verbergen de vaste onderbalken (bottom-tab + mini-speler) zich, zodat
  • src/views/pages/post-edit.ejs

    r4ad669a r408afc1  
    874874   tabbalk, anders zou die zweven boven de actiebalk. */
    875875body:has(.post-edit-page) .audio-player { bottom: 0; }
     876
     877/* Toetsenbord open op mobiel: de Opslaan/Annuleren-balk zweeft mee boven het
     878   toetsenbord (top wordt via JS o.b.v. de visual viewport gezet). Sticky bottom
     879   valt anders achter het toetsenbord → knoppen uit beeld. */
     880body.kb-open .pe-actions {
     881  position: fixed;
     882  left: 0; right: 0;
     883  margin: 0;
     884  z-index: 1001;
     885}
    876886</style>
    877887
     
    15671577
    15681578(function () {
    1569   // De Opslaan/Annuleren-balk boven de audiospeler houden als er iets speelt
    1570   // (anders dekt de fixed speler, z-index 1000, de sticky balk af). De echte
    1571   // speler-hoogte wordt gelezen, dus het klopt op elk formaat (de speler krimpt
    1572   // op smalle schermen). Geen speler → balk gewoon op bottom:0 (CSS).
     1579  // De Opslaan/Annuleren-balk goed positioneren in twee situaties:
     1580  //  1) Toetsenbord open (body.kb-open): balk FIXED pinnen aan de onderkant van de
     1581  //     ZICHTBARE viewport (boven het toetsenbord) — anders valt de sticky-bottom
     1582  //     balk achter het toetsenbord en zijn Opslaan/Annuleren uit beeld.
     1583  //  2) Audiospeler speelt: balk net boven de fixed speler houden (z-index 1000).
    15731584  var bar = document.querySelector('.pe-actions');
    15741585  if (!bar) return;
    1575   function fit() {
     1586  var vv = window.visualViewport;
     1587  function fitAudio() {
    15761588    var ap = document.querySelector('.audio-player');
    15771589    var playing = document.body.classList.contains('has-audio-player') &&
     
    15791591    bar.style.bottom = playing ? Math.round(ap.getBoundingClientRect().height) + 'px' : '';
    15801592  }
    1581   fit();
    1582   window.addEventListener('resize', fit);
    1583   // De speler verschijnt/verdwijnt via een body-class → daarop reageren.
    1584   try { new MutationObserver(fit).observe(document.body, { attributes: true, attributeFilter: ['class'] }); } catch (_) {}
     1593  function position() {
     1594    if (document.body.classList.contains('kb-open') && vv) {
     1595      bar.style.bottom = '';
     1596      bar.style.top = Math.round(vv.offsetTop + vv.height - bar.offsetHeight) + 'px';
     1597    } else {
     1598      bar.style.top = '';
     1599      fitAudio();
     1600    }
     1601  }
     1602  position();
     1603  window.addEventListener('resize', position);
     1604  if (vv) { vv.addEventListener('resize', position); vv.addEventListener('scroll', position); }
     1605  // kb-open + has-audio-player wisselen via een body-class → daarop reageren.
     1606  try { new MutationObserver(position).observe(document.body, { attributes: true, attributeFilter: ['class'] }); } catch (_) {}
    15851607})();
    15861608</script>
Note: See TracChangeset for help on using the changeset viewer.