Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silder in v0.12 breaks with smartphone turning #1369

Open
ChristianMayer opened this issue Sep 30, 2023 · 5 comments
Open

Silder in v0.12 breaks with smartphone turning #1369

ChristianMayer opened this issue Sep 30, 2023 · 5 comments

Comments

@ChristianMayer
Copy link
Member

ChristianMayer commented Sep 30, 2023

Using this very minimal config, version 0.12.4, an Android smartphone and turning the smartphone make troubles using the slider handle. Especially turning from portrait to landscape shows the issue:

  • The handle might stay outside the widget when it had a high value
  • On the first attempt the handle might not move further than the middle when started from the left side

Note: in the release version I could see that behavior, in a development build from the release-0.12 branch it's currently working as intended. (Although even there's a little hickup: on the phone the slider moves further than 100%, in the desktop chrome it's working)

<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lib_version="9" design="metal" xsi:noNamespaceSchemaLocation="../../visu_config.xsd">
  <meta>
    <mappings>
    </mappings>
    <stylings>
    </stylings>
    <plugins>
    </plugins>
  </meta>
  <page name="Minimalbsp"> 
        <slide step="1" format="%d%%">
          <address transform="DPT:5.001" mode="readwrite">1/2/3</address>
        </slide>
  </page>
</pages>
@ChristianMayer
Copy link
Member Author

@peuter right now my analysis of the issue is in a dead end. Could this be a timing issue where the changePageSizeInvalid is sent before the reading of the available space with window.getComputedStyle() is giving the correct number?

@peuter
Copy link
Member

peuter commented Oct 1, 2023

Seems like a timing issue, if I just defer the __invalidateScreensize call (in Slide.js constructur) it works for me:

this.__pageSizeListener = cv.ui.layout.ResizeHandler.states.addListener('changePageSizeInvalid', () => {
   (new qx.util.DeferredCall(this.__invalidateScreensize, this)).schedule();
});

(only tested in chrome with device emulation).

Maybe we need another event that is sent when the page size is valid again and you have to listen to that one?

@ChristianMayer
Copy link
Member Author

Documentation is very sparse about browser generated events during and after a page turn and validation.

In the meantime, and as I'm currently suspecting that only 0.12 is affected I created a hotfix that should suffice as a band aid.

@peuter
Copy link
Member

peuter commented Oct 1, 2023

In the meantime, and as I'm currently suspecting that only 0.12 is affected I created a hotfix that should suffice as a band aid.

That suspection is wrong, I can easily reproduce the same behaviour with the current development-branch. But my fix also works there, so I assume yours will too. So I suggest to cherry-pick it into the development branch. But there is one additional problem in the dev-branch: Inititialy the slider knob is way too far left (initial value is 100%), the fix does not change that.

@ChristianMayer
Copy link
Member Author

This issue actually caused multiple troubles on my side as the android browser behaved differently than the desktop chrome - and remote debugging of the android browser stopped the input events from working there 😲

So it's more a hot fix than a clean fix that solves the underlying timing issue. But it should be easy to cherry pick until there's a real fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants