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

Improve type for custom range value #1218

Merged
merged 2 commits into from
Aug 12, 2022
Merged

Improve type for custom range value #1218

merged 2 commits into from
Aug 12, 2022

Conversation

jackdomleo7
Copy link
Contributor

I've looked all over the docs and from what it seems when adding a custom range point, it must be in the format of a percentage, e.g. "50%".

range: {
  min: [0, 1],
  "50%": [20, 5],
  max: 50
}

This PR improves the type for the custom keys to ensure they match the pattern of a percentage as opposed to allowing any string such as "50 percent".

Please correct me if I've got this incorrect though, I just see no docs that say these custom values should be anything other than this.


Side note

When installing dependencies via npm i, it updated package-lock.json with the current version of this package, let me know if you want this reverting.

@leongersen leongersen merged commit f899a47 into leongersen:master Aug 12, 2022
@leongersen
Copy link
Owner

Thanks for this PR! You are quite correct, the format for the keys is always min/max/number%. I've merged this and released noUiSlider 15.6.1.

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.

2 participants