Shopify / polaris

Shopify’s design system to help us work together to build a great experience for all of our merchants.
https://polaris.shopify.com
Other
5.77k stars 1.17k forks source link

RangeSlider not working properly #12422

Open eran-pinhas opened 2 months ago

eran-pinhas commented 2 months ago

Summary

RangeSlider seems to incorrectly locate the cursor's position

Extra info:

Expected behavior

Dragging the min/max circles should match the cursor location

Actual behavior

ad954362-bf6f-4332-ab82-a5fa1a5caf09

Steps to reproduce

  1. Go to documentation page:
  2. Go to first example
  3. Add Money Spent filter
  4. Try to move the min or max selectors

Are you using React components?

Yes

Polaris version number

12.25.0

Browser

Chrome 126.0.6478.183

Device

MacOS 14.3.1

eran-pinhas commented 1 month ago

If anyone encounter the same issue, this is how we solved solved it 👇 . Not ideal, but what you're gonna do

setTimeout(() => {
  const event = new Event('resize');
  window.dispatchEvent(event);
}, 100);
goldenpine commented 1 week ago

You saved my day! Thank you @eran-pinhas I used that code snip but without setting the timeout.