Subscribe on changes!

Range input does not update value correctly when setting max and value together

avatar
Nov 19th 2021

Version

3.2.22

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • Create input type=range
  • Dynamically (e.g. on button press) change max and set value to max using a watch

What is expected?

  • Both max and value of the input have the same value

What is actually happening?

  • The max updates correctly but value does not correctly update and jumps to an old value
avatar
Nov 19th 2021

In this scenario you need to use a post watcher because the change of the max attribute needs to be applied before the value (this is specific to inputs of type range).