Closed AlGantori closed 5 years ago
Hello, thanks for opening an issue with us. Would you mind posting a plunker or minimal repo we could use to reproduce this issue? Thanks!
Here is the plunker you requested http://plnkr.co/edit/ps2YEfwdHhgC0YcU0lJ2?p=preview
It should render like this....
Any news on this issue?
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!
Thank you for using Ionic!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/219
Ionic version: (check one with "x") [ ] 1.x [ ] 2.x [x] 3.x
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior: I have the following prop in my data provider/service...
Here is the html
If I enable the console.log I will see a zillion calls to the Comparisons property while I try to move the slider (range) and it responds very very slowly and the range pin won't even display, rendering this user control not usable.
I would like the 2-way binding between the ranges and some corresponding model in my data provider class (an array of integers representing the latest values).
Expected behavior: range sliders responds to human interaction
Steps to reproduce: make a provider return an array of 3 numbers and use it to insert 3 range selectors bound to each element of this collection. The insertion in the view should be done via an *ngFor (ie. dynamic)
Here is a plunker http://plnkr.co/edit/ps2YEfwdHhgC0YcU0lJ2?p=preview
-->
Related code: Other information: If I remove the ngModel altogether I get a normal UI response from the range selectors, smooth sliding, the pin pops, shows value and has an animation, but of course all ranges inserted in this manner are just vanilla, unbound and no initial value.
UPDATE It appears as if inserting ranges via the ngFor AND making them bound is the problem. My current test data returns an array of 3 numbers, if I insert an instance of the range bound to the second element as below explicitly before the ngFor, then I get the following behavior on the 4 resulting ranges in the view. This first instance responds just fine to human interaction and also causes the 3rd instance to sync (expected). However, all 3 instances (2nd, 3rd and 4th) of the range control inserted via the *nfFor do not respond to human interaction (I guess busy making calls to the bound model).
IMPROVEMENTS Why doesn't ion-range work like other ionic components eg. label, textbox, etc... why is ngModel needed? Could it be simplified to something like
<ion-range>{{w}}<ion-range>
other parameters could be supplied as attributes. including the initial/bound value like so:
<ion-range min="0" max="100" value="{{w}}" ><ion-range>
This would make it more intuitive and ionic-like :) Thank you.