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

Slider out of sync when layout changes #141

Open
troibe opened this issue Mar 18, 2021 · 7 comments
Open

Slider out of sync when layout changes #141

troibe opened this issue Mar 18, 2021 · 7 comments
Labels
bug Something isn't working upstream

Comments

@troibe
Copy link

troibe commented Mar 18, 2021

Describe the bug
The slider values get out of sync when the layout changes or sometimes even on load. After resizing the window everything works as expected

To Reproduce
Either go to the demo website material-components-web-elm or the demo website of material-components-web-miso. On the elm website then open the sandwich menu and then move the slider. On the miso website the slider is opened already and the slider out of sync on page load.

Expected behavior
The slider should be in sync on page load and after layout changes.

Screenshots
Elm:

  • before drawer is expanded -> works as expected
  • after drawer is expanded -> slider out of sync
  • window resized and drawer expanded -> works as expected
    elm

Miso:

  • drawer is expanded by default -> slider out of sync
  • window resized and drawer still expanded -> works as expected
    miso

Desktop (please complete the following information):

  • OS: ubuntu
  • Browser: chrome

Additional context
I'm porting the material-components-web-elm to material-components-web-miso. Fortunately I can reuse all of the javascript.
Unfortunately I wasn't able to build the javascript on the Master branch so the issue might be already fixed on Master but it occurs on 6.0.0.

@troibe
Copy link
Author

troibe commented Mar 18, 2021

I'd be happy to look into this myself if you could give me some pointers on how to build the current version on the Master branch and which typescript files are relevant.

@aforemny
Copy link
Owner

Hi @developandplay, thank you for reporting this. I feel like this has come up before. I would look into the upstream issues and see when it was fixed and why it is not fixed in our code base. I feel like it should have been fixed in material-components-web-6.0.0 already, which this library is currently using. Note that I am building from a fork inside the submodule material-components-web, so I might have maybe introduced in error in one of my patches.

I might get around investigating this myself, but if you want to take a stab at it, I'd appreciate it! Recent master should build again! You have to clone this repository and submodules and run make. Let me know if you have any problems with that!

I am also very excited to see material-components-web-miso. Please do feel free to reach out to me if you want to discuss anything!

@troibe
Copy link
Author

troibe commented Mar 19, 2021

Hm the way you setup the submodule gives me a permission denied error when using git clone --recursive.
Probably because you used the ssh url instead of the https url in .gitmodules which requires a key.
I'm going with manually cloning the submodule for now which works for me.

@troibe
Copy link
Author

troibe commented Mar 19, 2021

This seems to be #69 reoccurring.
Upon first inspection I don't see any regressions that could have caused this.

@aforemny
Copy link
Owner

I think this is still an unresolved upstream bug material-components/material-components-web#1017 (later comments talk about the interaction with drawer instead of dialog).

@aforemny
Copy link
Owner

I could expose layout() from the custom element if that would help you.

@aforemny aforemny added bug Something isn't working upstream labels Mar 26, 2021
@troibe
Copy link
Author

troibe commented Mar 26, 2021

I think that sounds like a good idea in the meantime.
That being said it's not super critical so we can also just wait until google does something about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants