Skip to content

Commit ba0d581

Browse files
committed
Deleted unnecessary 'this._isValidIndex(optionIndex)' check
1 parent f22f419 commit ba0d581

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/lib/list/selection-list.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,14 @@ export class MdSelectionList extends _MdSelectionListMixinBase
171171
// Watch for focus events outside of the keyboard navigation
172172
option.onFocus.subscribe(() => {
173173
let optionIndex: number = this.options.toArray().indexOf(option);
174-
175-
if (this._isValidIndex(optionIndex)) {
176-
this._keyManager.updateActiveItemIndex(optionIndex);
177-
}
174+
this._keyManager.updateActiveItemIndex(optionIndex);
178175
});
179176

180177
// On destroy, remove the item from our list, and check focus
181178
option.destroy.subscribe(() => {
182179
let optionIndex: number = this.options.toArray().indexOf(option);
183180

184-
if (this._isValidIndex(optionIndex) && option._hasFocus) {
181+
if (option._hasFocus) {
185182
// Check whether the option is the last item
186183
if (optionIndex < this.options.length - 1) {
187184
this._keyManager.setActiveItem(optionIndex);

0 commit comments

Comments
 (0)