pqina / filepond-plugin-image-preview

🖼 Show a preview for images dropped on FilePond
https://pqina.nl/filepond
MIT License
46 stars 26 forks source link

Image preview flashes while scrolling on an iPhone #13

Closed oldrich-s closed 5 years ago

oldrich-s commented 5 years ago

How to reproduce:

  1. Use iPhone with latest iOS
  2. Open https://pqina.nl/filepond/
  3. Scroll to "Multiple File Upload"
  4. Click on "Browse"
  5. Select a picture
  6. Wait until it loads
  7. Swipe up and down
  8. Observe how the image flashes
rikschennink commented 5 years ago

It's because the browser window is resized (vertically). It hides the images when this happens so it's faster to update the views.

oldrich-s commented 5 years ago

How can window be resized vertically when scrolling?

rikschennink commented 5 years ago

On iOs it is because it shows and hides the bottom menu bar which impacts the window height.

oldrich-s commented 5 years ago

I see, would it not make sense to exclude it from re-rendering? Something like:

image

rikschennink commented 5 years ago

I'm looking into this now, but requesting innerHeight on each resize is performance intensive. Also, I want to stay away from fixed values. So I'm testing if the width is changing, should be fixed later today.

oldrich-s commented 5 years ago

ok, perfect 👍

rikschennink commented 5 years ago

Fixed in version 4.1.4