-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: range slider min/max with ng-model doesnt work #1948
Comments
@perrygovier, want to take a look at this? Here is an updated codepen with referencing the nightlies |
I have run into this same problem. In fact, it looks like when setting the max dynamically the initial position is set correctly if the initial value is 100 or less. But if it is over 100, then it is initially set to 100. Example with max: 200 and value: 50 and no step setting (works correctly) Example with max: 200 and value: 195 and no step setting (doesn't work correctly, initial slider position set to 100) |
Greetings! Due to this issue's age and inactivity, it has been closed. If you are still experiencing this issue, please feel free to reopen it so we may assist you. Thank you for allowing me to assist you. |
This issue is still here. When using a configurable max > 100, if max is a scope value, max will be set automatically to 100 when changing view and returning back to the range page. But in some cases (a popover with a range inside for example), it will return to 100 I tried bind once (::) of angular 1.3 but doesn't seems to prevent that. The only solution is to use another range directive? Thanks, |
Agree with mellinas. This issue is still here. |
This appears to be an issue with angular not supporting input type="range". I tried a pure angular project without anything ionic and the issue is still there. |
Can confirm this issue |
I use these directives to resolve the issue: .directive('ngMin', function() {
return {
restrict : 'A',
require : ['ngModel'],
compile: function($element, $attr) {
return function linkDateTimeSelect(scope, element, attrs, controllers) {
var ngModelController = controllers[0];
scope.$watch($attr.ngMin, function watchNgMin(value) {
element.attr('min', value);
ngModelController.$render();
})
}
}
}
})
.directive('ngMax', function() {
return {
restrict : 'A',
require : ['ngModel'],
compile: function($element, $attr) {
return function linkDateTimeSelect(scope, element, attrs, controllers) {
var ngModelController = controllers[0];
scope.$watch($attr.ngMax, function watchNgMax(value) {
element.attr('max', value);
ngModelController.$render();
})
}
}
}
}) |
@jwgmeligmeyling the directives that you proposed solved my problem, thanks! |
@JavierAbrego No problem 😊 Sad that this issue is still around. But I think this is more an Angular issue than an Ionic issue. |
Thanks @jwgmeligmeyling , Help me also!!! 👍 👍 👍 |
Thank you, helped me as well! |
Thank you so much!! |
This issue should not have been closed by @Ionitron .... |
I'll take another look |
This appears to be fixed in current versions of Angular, no? Not seeing any issues in http://codepen.io/mhartington/pen/mFtji?editors=101 |
Seems this is indeed fixes as of 1.3.0-rc.1 with angular/angular.js@7b273a2 (issue angular/angular.js#2404). Codepin was not updated yet. Update: The codepin was indeed on angular v1.2.17 |
Greetings @amitksaini78! My sensors indicate a reply was requested, but as we have not received one yet, I am using my robot powers to close this issue. However, if you are still experiencing this issue, please feel free to reopen it by creating a new issue, and include any examples or necessary information. Thank you for allowing me to assist you. |
The issue is still there. I' m using Ionic cli 2.0.0-beta.12. |
Yeap, we can also confirm issue is still here. Using Ionic 1.2.4 and Angular v1.4.3. This code doesnt work: And this one does: Exactly the same issue as http://codepen.io/mhartington/pen/mFtji |
+1 |
Struggling with the same issue here... |
+1 same problem with Ionic 1.2.4 and 1.3 |
+1 Using both value and ng-model When removing ng-model, problem is solved however I do not get real time update of value when the user drags. Ionic 1.3.1 |
+1 Still seeing this in angular 1.5.3 (ionic 1.3.1).
where the estimatedPoints is exactly in the middle of the min & max. Seems related to: angular/angular.js#6726 EDIT: JWGmeligMeyling's directives worked for me. |
worked for me
in controller: |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Type: bug
Platform: all
Basically, take range input min, max and value with ng-model=user.value:
$scope.user= {
min:'0',
max:'20000',
value:'10000'
}
Steps to reproduce:
Does not work :(
now remove the ng-model, it works :)
http://codepen.io/anon/pen/kqAlv
Not sure where to park this bug. Is it a ionic/angular issue?
But before you throw away this bug as not my problem consider this: Having configurable min and max with ng-model is a basic requirement of a slider!
The problem is described here in detail:
http://forum.ionicframework.com/t/how-to-make-ionic-range-slider-min-and-max-configurable-instead-of-hard-coded-0-and-100/7800
The text was updated successfully, but these errors were encountered: