angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Add support for the input type=range

Open andybak opened this issue 12 years ago • 59 comments

Originally filed here: https://github.com/angular/angular.js/issues/1189

(This was incorrectly closed and despite requests to reopen, has remained closed so I'm reposting as a new ticket. For future reference, closing old tickets due to lack of activity is probably not a good idea.)

With multiple inputs to the same model doesn't play ball. It works as an input but updating it to a value set from another input always fails. Even if the source is also constrained as numeric (type="range" in chrome). This is due to the model being stored as a string.

Demo: http://jsfiddle.net/TXazw/5/Edit Edit any input except the number and everything updates except the number input. Edit the number input and everything works fine.

A workaround is included. Uncomment parseFloat line and all inputs work correctly.

Should values not be automatically parsed when applied to a number type input? At the very least type="range" should be outputting a number rather than a string.

Discussed in the group: https://groups.google.com/forum/?fromgroups#!topic/angular/Ecjx2fo8Qvk

andybak avatar Jan 20 '14 09:01 andybak

+1

Ore4444 avatar Jul 05 '15 07:07 Ore4444

+1

alitahir360 avatar Jul 11 '15 13:07 alitahir360

People have been writing +1 for 1.5 years. Can someone on the angular team comment?

seriema avatar Jul 13 '15 18:07 seriema

(You mean like add a +1 themselves ? :stuck_out_tongue:)

gkalpak avatar Jul 13 '15 20:07 gkalpak

This issue has the PRs plz label, which means that it would be a welcome addition and easy enough for a non-core member/external contributor to impelement. It also has the Lots of comments label, which indicates that it is under the team's radar.

So, there's not much more to comment about it I guess (for the time being at least). If they haven't taken care of it yet, it's probably because they have been attending to other issues (bug fixes, perf improvements, features, chores) that were higher in priority (for whatever reason).

Patience poor issue...your turn will come...(unless, you know, it doesn't)...

(Not speaking on behalf of the team or anything...)

gkalpak avatar Jul 13 '15 20:07 gkalpak

@seriema #9715 is a PR for this issue. It's currently marked 1.5-candidate, so it may be resolved in v1.5

TylerEich avatar Jul 13 '15 22:07 TylerEich

+1

rcollette avatar Jul 23 '15 22:07 rcollette

+1

MrFranke avatar Oct 05 '15 14:10 MrFranke

+1

maxprof avatar Oct 07 '15 17:10 maxprof

+1

kunalnavhate avatar Nov 13 '15 07:11 kunalnavhate

+1

michael-wirth avatar Nov 20 '15 12:11 michael-wirth

+1

ivorafael avatar Nov 26 '15 19:11 ivorafael

+1

Tyutyesz avatar Dec 09 '15 13:12 Tyutyesz

+1

westonganger avatar Jan 01 '16 02:01 westonganger

+1.

Just traced a weird-looking bug to this - in a language where ("7" + 3) * 10 is 730, having obviously-numeric values be strings is just asking for sensible-looking code to produce insane values.

FLHerne avatar Feb 03 '16 10:02 FLHerne

+1

tayloj avatar Feb 17 '16 19:02 tayloj

+1

ohcrfpv avatar Apr 20 '16 09:04 ohcrfpv

+1

dennybiasiolli avatar Jul 05 '16 13:07 dennybiasiolli

To summarize: The bug has been fixed in version 1.5.9. But for it to work you have to add the attribute ng-input-range to the input[type=range] element. This is not necessary for Angular.js 1.6.

https://code.angularjs.org/1.5.9/docs/api/ng/input/input%5Brange%5D

sbaechler avatar Jul 05 '17 16:07 sbaechler