How to make PWA to Refresh on pull down?

I have a vaadin project with latest version. It is a PWA. i would like to add functionality to refresh on pull down. Right now if I pull down, it just shows the theme color but never refreshes the page. I am using iPhone to test PWA.

I was about to comment that isn’t that enabled by default these days by the browser/os, at least on iOS. But checked before commenting and it looks like it is on only in Safari. Don’t know the situation on modern Adroids.

So using/abusing some JS libraries that is.

Depending a bit what you are aiming at, you most probably want to customise the behaviour a bit. Instead of full reload, you most likely just want to visit server.

With “browser mode” one might also want to overrided the behaviour (if it is possible), so that instead of reloading the whole page you’d e.g. only check for new messages from the server.

I would like to re-render the current route. But, if I make the ui.getPage().reload(); it refreshes the whole page. I just want content to refresh and not the Layout. Like the same behavior we get when route is navigated.
So i tried to go to do fetchCurrentUrl and navigate to url.path but it does not do anything as it detects the page is same.
Right now, I just updated one page with custom behavior to refresh the needed part on click of a button.

There is an add-on for that: pulltorefresh }> add-on - Vaadin Add-on Directory (just custom tailored it for you :man_bowing: )

Thank you very much!!!