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

[vwc-slider] inside initially closed [vwc-expansion-panel] trapped in desynchronized state #789

Closed
k-paxian opened this issue Apr 20, 2021 · 2 comments · Fixed by #791
Closed
Labels
Type: Bug 🐞 Something isn't working

Comments

@k-paxian
Copy link
Collaborator

k-paxian commented Apr 20, 2021

Describe the bug

[vwc-slider] element when being initially closed inside [vwc-expansion-panel] is trapped in desynchronized state when
opening the panel by clicking it.

To Reproduce
Steps to reproduce the behavior:

  1. Put a configured slider element with certain value set inside initially closed vwc-expansion-panel
  2. Click on vwc-expansion-panel to open it
  3. Observe the slider state, rendered visuals are desynchronized: circular Tick is rendered at the left most side, and the bold line ends and rendered properly is indicating the actual slider value: 2

Expected behavior
Slider should be rendered initially properly when it's hidden inside [vwc-expansion-panel] element

Screenshots

Slider on screens is configured with the range from 1 to 10

Initially the panel is closed
image
When opening, we could observe the unwanted rendering state
image
When hovered, tick tooltip is showing selected value which is 2, but the tick itself is rendered at the left most edge of the slider
image

Desktop

  • OS: Windows
  • Browser chrome
  • Version 89.0.4389.128 (Official Build) (64-bit)

Additional context

When triggering manual browser window resize operation during desynchronized state, sliders suddenly will be rendered properly ✔️

@k-paxian k-paxian added the Type: Bug 🐞 Something isn't working label Apr 20, 2021
@gullerya
Copy link
Contributor

Thanks for the detailed description!

@gullerya
Copy link
Contributor

gullerya commented Apr 20, 2021

Few points:

  • the issue is due to the non-reactive use of getBoundingClientRect, which result is a basis for thumb's shift calculation
  • each time the slider rendered in display: none, for example, container - the issue will be reproduced
  • MWC team has an issue opened on this topic here - I've added my observations there as well
  • meanwhile there is this PR, where the issue solved with ResizeObserver, until MWC team will provide their solution

gullerya added a commit that referenced this issue Apr 21, 2021
gullerya added a commit that referenced this issue Apr 21, 2021
…n display none or resized (#791)

* issue #789: fixing the slider miscalc when resized

* issue #789: implementing the debouncer as decorator

* issue #789: implementing the debouncer as decorator

* issue #789: removing unneded rule relax

* issue #789: implementing the debouncer as decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
None yet
2 participants