tech-systems / panes

🎉📱 Create dynamic modals, cards, panes for your applications in few steps. One instance – Thousands solutions. Any framework and free.
https://panejs.com
MIT License
687 stars 40 forks source link

[BUG] Incorrect processing of removing focus from input #208

Closed Noothing closed 1 year ago

Noothing commented 1 year ago

Incorrect processing of removing focus from input on android devices. As the result, styles and meta tag "viewport" is still for focused input, but cupertino is closed. I have tried to make input blur before closing pane, but it is not working

Steps to reproduce the behavior:

  1. Open cupertino with input inside
  2. Focus on input
  3. Press hand made close button
  4. Meta tag

Some screens: image image

Expected behavior: Removing all styles on blur

roman-rr commented 1 year ago

@Noothing Thank you. Quick solution for you:

let settings = {
   // ...
   events: {
     onWillDismiss: (ev) => {
         document.documentElement.style.removeProperty('overflow');
         document.body.style.removeProperty('min-height');
         document.querySelector('meta[name=viewport]').setAttribute('content', 'viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no');
     }
   }
};