Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Slider crashes when max and min set by databinding and min is greater than 100 #158

Open
8 tasks
akc42 opened this issue Nov 25, 2016 · 0 comments
Open
8 tasks

Comments

@akc42
Copy link

akc42 commented Nov 25, 2016

Description

paper-slider crashes an attempt to create a new array with a negative number of entries.

This is because I am setting min and max (and step) via databinding from properties that have to be calculated and the order that the calculations happen, and therefore max and min get set cannot be guaranteed. I set min to 540, and max is still left at its default value of 100 (It should get set to 1020 very shortly afterwards)

_updateMarkers gets called because its an observer on (amongst other things) max and min. Because min is greater than max, the number of steps gets calculated as a negative number. THis negative number is used to create a new Array() and this throws the exception

Expected outcome

The slider doesn't fail

Actual outcome

There is an uncaught RangeError exception .

Live Demo

Steps to reproduce

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant