angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.28k stars 6.72k forks source link

bug(Slider): Rounded thumb label text value, inconsistent with actual value #27445

Closed teodorachiosa closed 1 year ago

teodorachiosa commented 1 year ago

Is this a regression?

The previous version in which this bug was not present was

14.2.7

Description

Rounded thumb label text value, inconsistent with actual value.

Reproduction

StackBlitz link: Not needed. Can be reproduced on the Material demo page for Slider. Steps to reproduce:

  1. Go to: https://v15.material.angular.io/components/slider/examples#slider-configurable (can also be reproduced on v16.1.4)

  2. Enable the "Show thumb label" checkbox

  3. Write the value: 12.5

  4. Write the step size value: 1 There's already an inconsistency, the value stored is 12.5 but the thumb label says 13. image

  5. Write the step size value: 0.5 The thumb label is still rounded. image

Expected Behavior

For the value 12.5 with the step value 0.5, I expect the thumb label to be 12.5.

When changing the step size, I expect that the thumb label is also updated accordingly. The thumb label updates accordingly only after changing the slider value.

Actual Behavior

For the value 12.5 with the step value 0.5, the thumb label shows the value 13.

Changing the step size doesn't update the thumb label text accordingly.

Environment

wagnermaciel commented 1 year ago

This is actually not a bug with the slider but a problem with the value displayed in the "Result" section of the example. The value being displayed is currently just the value entered in the "Value" input. I've created a fix for this to change that value to equal the current value of the slider (which in this case is correctly 13)

angular-automatic-lock-bot[bot] commented 1 year ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.