question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V14 - ExtendedClientDetails isIPad method does not work

See original GitHub issue

Description of the bug

In Vaadin 14, trying to use ExtendedClientDetails#isIPad() to detect an Ipad device always returns false.

Expected behavior

ExtendedClientDetails#isIPad() should return true if used device is Ipad.

Minimal reproducible example

ui.getPage().retrieveExtendedClientDetails(details -> {
      boolean isIPadValue = details.isIPad();
      Notification.show(isIPadValue ? "ipad" : "not ipad");
});

Versions

  • Vaadin / Flow version: 14.8.15
  • OS version: 9th generation iPad running iOS 15.4 & iPad Air 2 running iOS 15.5

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollovaticommented, Sep 14, 2022

A solution can modify ExtendedClientDetails.isIpad be to always delegate to WebBrowser checks if navigatorPlatform does not start with iPad (that basically is the same as the proposed workaround, but done server side)

Original check

   public boolean isIPad() {
        if (navigatorPlatform != null) {
            return navigatorPlatform.startsWith("iPad");
        }
        WebBrowser browser = VaadinSession.getCurrent().getBrowser();
        return browser.isIPad() || (browser.isMacOSX() && isTouchDevice());
    }

Potential change

    public boolean isIPad() {
        if (navigatorPlatform != null && navigatorPlatform.startsWith("iPad")) {
            return true;
        }
        WebBrowser browser = VaadinSession.getCurrent().getBrowser();
        return browser.isIPad() || (browser.isMacOSX() && isTouchDevice());
    }
0reactions
vaadin-botcommented, Oct 3, 2022

This ticket/PR has been released with Vaadin 23.3.0.alpha1 and is also targeting the upcoming stable 23.3.0 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vaadin/flow 3.0.0 on GitHub - NewReleases.io
The Java API to configure the contents of the bootstrap page is changed to ... BrowserDetails#isIPad() are replaced with method in ExtendedClientDetails ......
Read more >
Deprecated API - Vaadin
This is an internal class for Flow and should not be used outside. This is deprecated since 1.3 and will be removed in...
Read more >
Index (Flow Server 2.7.6 API) - javadoc.io
Validation class that is run during servlet container initialization which checks that specific annotations are not configured wrong.
Read more >
Upgrade Guide Generator | Upgrading | Vaadin Docs
Instructions for upgrading to the latest Vaadin version. To run applications or components developed with Vaadin 7 or 8 inside an application written...
Read more >
Remove composer patches and update taxonomy label tests for WP ...
Fixes: https://github.com/johnbillion/extended-cpts/issues/197 ... flow V14 - ExtendedClientDetails isIPad method does not work 6 open 🗓️ 1 week ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found