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

tooltip placement on range component #1979

Closed
Labels
bug Things that aren't working right in the library.

Comments

@RoCat
Copy link
Contributor

RoCat commented Apr 15, 2024

Describe the bug

When using variable tooltips sizes with sl-range, the tooltip horizontal placement is imprecise. It seems to follow the previous tooltip length, or maybe a avg between last and current ?

To Reproduce

Just edited the Custom Tooltip Formatter codepen example and add dumby logic for changing tooltip size


<sl-range min="0" max="100" step="1" class="range-with-custom-formatter"></sl-range>

<script>
  const range = document.querySelector('.range-with-custom-formatter');
  range.tooltipFormatter = value => `Total - ${Math.round(value / 2) === (value / 2) ? 'short' : 'xtra xtra xtra xtra long'}%`;
</script>```

### Browser / OS
 - OS: mac
 - Browser: chrome
 - Browser version: 123.0.6312.87 

### Additional information
To give a bit more context than just a dumb example, my use case is to have relative date filters:
no filters
last 12 months
last 6 months
etc
@RoCat RoCat added the bug Things that aren't working right in the library. label Apr 15, 2024
@KonnorRogers
Copy link
Collaborator

🤔 Thanks for this. I can reproduce, very interesting.

https://codepen.io/paramagicdev/pen/MWRxXqg?editors=1000

claviska added a commit that referenced this issue May 10, 2024
@claviska
Copy link
Member

Thanks for reporting this. Fixed in 8726910.

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