Skip to content

[calcite-slider] The snapping mode does not honor the min setting #6229

Closed
@fendiaoxiaoshuazi

Description

@fendiaoxiaoshuazi

Actual Behavior

  1. The min value is not honored in snap mode, the snap value is not correct. e.g. I cannot snap to 1,3,5,7,9 with min=1 step=2
    image

  2. The value will be toFixed according to the decimal places of step, but when I have decimal min value and integer step value, the min value cannot be snapped even if the above issue is fixed

  3. When the max value does not meet the step setting, it can be snapped sometimes when the calculation rounds up
    image

Expected Behavior

  1. The snapped function should consider min value
  2. The snapped function should also consider the decimal places of the min value
  3. The max value should not be snapped if it does not meet step setting

Reproduction Sample

https://codepen.io/fendiaoxiaoshuazi/pen/zYLKEXb?editors=1000

Reproduction Steps

  1. Try sample 1, you cannot scroll to 1,3,5,7,9
  2. When the first issue is fixed, the 1.5 min value cannot be reached
  3. The max 10.5 can be snapped but this is not correct

Reproduction Version

beta.97

Relevant Info

No response

Regression?

No response

Impact

No response

Esri team

N/A

Metadata

Metadata

Labels

4 - verifiedIssues that have been tested, confirmed as mitigated, and are ready to close.bugBug reports for broken functionality. Issues should include a reproduction of the bug.c-sliderIssues that pertain to the calcite-slider componentestimate - 2Small fix or update, may require updates to tests.impact - p2 - want for an upcoming milestoneUser set priority impact status of p2 - want for an upcoming milestonep - mediumIssue is non core or affecting less that 60% of people using the library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions