Skip to content

Fix Slider and RangeSlider when min or max changes in a callback #616

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

Merged
merged 4 commits into from
Jul 12, 2025

Conversation

AnnMarieW
Copy link
Collaborator

Fixes #615

Dragging the handle causes MantineSlider to calculate the new value based on the handle’s position. However, the MantineSlider is storing the drag’s position as a percent of the old range.

Using a key based on the min and max remounts the slider whenever min or max changes, resetting the drag state.

Copy link

github-actions bot commented Jul 9, 2025

Test Environment for snehilvj/dash-mantine-components-616
Updated on: 2025-07-09 17:28:37 UTC

@AnnMarieW
Copy link
Collaborator Author

Here's the sample app from the issue https://py.cafe/amward/DMC-PR-616-Fix-Slider

@AnnMarieW AnnMarieW marked this pull request as ready for review July 9, 2025 18:47
@AnnMarieW AnnMarieW requested a review from alexcjohnson July 11, 2025 15:35
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Good job diagnosing the issue, and very nice solution!

@AnnMarieW AnnMarieW merged commit a53608a into snehilvj:master Jul 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Slider and RangeSlider break if range is changed in a callback.
2 participants