Skip to content

Commit

Permalink
fix(list): minor changes on self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiomkar committed Jan 5, 2019
1 parent 2ea1d3b commit 38a34de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/mdc-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ When rendering list with checkbox items all pre-selected list items should conta
</ul>
```

The `selectedIndex` (that proxies foundation's `setSelectedState()`) accepts list of indexes in array format or single index to set the selection state. It overwrites the current state with new selected state whether it is a list of indexes or single index.
The `selectedIndex` (that proxies foundation's `setSelectedState()`) accepts list of indexes in array format for list with checkbox items to set the selection state. It overwrites the current state with new selected state.

## Style Customization

Expand Down
8 changes: 3 additions & 5 deletions packages/mdc-list/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ class MDCListFoundation extends MDCFoundation {
}
}

this.focusedItemIndex_ = currentIndex;

if ((this.isVertical_ && arrowDown) || (!this.isVertical_ && arrowRight)) {
this.preventDefaultEvent_(evt);
nextIndex = this.focusNextElement(currentIndex);
Expand All @@ -237,12 +235,12 @@ class MDCListFoundation extends MDCFoundation {
}
}

this.focusedItemIndex_ = currentIndex;

if (nextIndex >= 0) {
this.setTabindexAtIndex_(nextIndex);
this.focusedItemIndex_ = nextIndex;
}

this.focusedItemIndex_ = currentIndex;
}

/**
Expand Down Expand Up @@ -354,7 +352,7 @@ class MDCListFoundation extends MDCFoundation {
}

/**
* Toggles checkbox or radio at give index. Radio doesn't change the checked state if it is already checked.
* Toggles radio at give index. Radio doesn't change the checked state if it is already checked.
* @param {number} index
* @private
*/
Expand Down

0 comments on commit 38a34de

Please sign in to comment.