-
Notifications
You must be signed in to change notification settings - Fork 27.5k
limitToFilter() handles Infinity incorrectly #6771
Comments
maybe this is a bug, but it seems like a weird thing to use Infinity for, what is the use case? Are you sort of trying to use this to toggle between limiting and not limiting? |
parseInt(Infinity, 10) will result in NaN, which becomes undesirable when the expected behaviour is to return the entire input. I believe this is possibly useful as a way to toggle input limiting based on certain factors. Closes angular#6771
Yeah pretty much. If a user sets
|
I think the expected behaviour of |
I'm doing |
Alright, well, want to test my PR and see if that logic works for you? I'm not sure when/if it will land, though. It's a pretty simple fix and shouldn't be a breaking change, so we can probably triage it for the next beta, if not this one. |
Cool, I'll take a look later today. Thanks for the quick response :) |
parseInt(Infinity, 10) will result in NaN, which becomes undesirable when the expected behaviour is to return the entire input. I believe this is possibly useful as a way to toggle input limiting based on certain factors. Closes angular#6771
I think a better solution for this issue would be using array's length instead of Infinity. Example: I wanted to show a paginated table with a search input and when input value is different from '', pagination should be disabled so that it can show all filtered items in the same view.
|
If the limit argument is Infinity, it's parsed to NaN by int()
limit should remain Infinity
The text was updated successfully, but these errors were encountered: