Changeset f3f43df in Klonkt for src/views/shell.ejs


Ignore:
Timestamp:
06/19/2026 12:35:04 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
e22230e
Parents:
c01f471
Message:

ui: text fields grow with content instead of scrolling internally (no scroll-in-scroll)

  • Global textarea auto-resize in shell.ejs (grows with content, no internal scrollbar; also after htmx swaps).
  • Post editor: inline scroll box removed → the writing field grows with the content. Typing on mobile/tablet always goes fullscreen anyway (only scroll = the page).

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    rc01f471 rf3f43df  
    552552</script>
    553553
     554<!-- Auto-resize: elk <textarea> groeit mee met de inhoud i.p.v. intern te scrollen
     555     (scroll-binnen-scroll is verwarrend). Site-breed; ook na htmx-swaps. -->
     556<script>
     557(function () {
     558  function autoSize(ta) {
     559    if (!ta || ta.tagName !== 'TEXTAREA') return;
     560    ta.style.overflowY = 'hidden';
     561    ta.style.height = 'auto';
     562    ta.style.height = ta.scrollHeight + 'px';
     563  }
     564  function sizeAll(root) {
     565    (root || document).querySelectorAll('textarea').forEach(autoSize);
     566  }
     567  document.addEventListener('input', function (e) { autoSize(e.target); });
     568  document.addEventListener('focusin', function (e) { autoSize(e.target); });
     569  // Init + opnieuw na htmx-navigatie/partials.
     570  sizeAll();
     571  document.body.addEventListener('htmx:afterSettle', function () { sizeAll(); });
     572  window.addEventListener('load', function () { sizeAll(); });
     573})();
     574</script>
     575
    554576<!-- PWA install prompt — show button when browser fires beforeinstallprompt -->
    555577<script>
Note: See TracChangeset for help on using the changeset viewer.