This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(radioButton): arrowkey navigation with disabled buttons
Closes #1040.
- Loading branch information
1 parent
504c946
commit f520d50
Showing
4 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,14 +329,17 @@ angular.module('material.core') | |
* @param {optional} validate | ||
* @returns {*} | ||
*/ | ||
function next(item, validate) { | ||
function next(item, validate, limit) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ThomasBurleson
Author
Contributor
|
||
validate = validate || trueFn; | ||
|
||
if (contains(item)) { | ||
var index = indexOf(item) + 1, | ||
found = inRange(index) ? _items[ index ] : (reloop ? first() : null); | ||
found = inRange(index) ? _items[ index ] : (reloop ? first() : null); | ||
|
||
return validate(found) ? found : next(found, validate); | ||
// Infinite loop check... | ||
if ( reloop && (indexOf(found) === limit) ) return null; | ||
|
||
return validate(found) ? found : next(found, validate, limit || index); | ||
} | ||
|
||
return null; | ||
|
Didn't really looked into what this does exactly, but this function seems to be in need of a generous refactoring :)