Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Menu: Add selected property to menu items #618

Closed
7 tasks done
trimox opened this issue Feb 7, 2018 · 0 comments
Closed
7 tasks done

Menu: Add selected property to menu items #618

trimox opened this issue Feb 7, 2018 · 0 comments
Assignees
Labels
enhancement new-mdc-feature Feature incorporated from material-components-web

Comments

@trimox
Copy link
Owner

trimox commented Feb 7, 2018

Change as per material-components-web v0.30.0
reference: material-components/material-components-web#2084

Adds mdc-list-item--selected class to menu items when rememberSelection is set to true.
Auto-focuses on the last selected item when opened and rememberSelection is set to true.

Foundation APIs

  • Add setAttrForOptionAtIndex(index, attr, value) {}
  • Add rmAttrForOptionAtIndex: (index, attr) => {}
  • Add addClassForOptionAtIndex: (index, className) => {}
  • Add rmClassForOptionAtIndex: (index, className) => {}

Foundation methods

  • Add setRememberSelection(rememberSelection: boolean)
  • Add getSelectedIndex(): number
  • Add setSelectedIndex(index): void
@trimox trimox added enhancement new-mdc-feature Feature incorporated from material-components-web labels Feb 7, 2018
@trimox trimox added this to the Milestone v0.7.6 milestone Feb 7, 2018
@trimox trimox self-assigned this Feb 7, 2018
trimox added a commit that referenced this issue Feb 14, 2018
trimox added a commit that referenced this issue Feb 14, 2018
Change as per material-components-web v0.30.0
reference: material-components/material-components-web#2084

Adds `mdc-list-item--selected` class to menu items when `rememberSelection` is set to `true`.

#### New Public methods
- [x] Add `setRememberSelection(rememberSelection: boolean)`
- [x] Add `getSelectedIndex(): number`
- [x] Add `setSelectedIndex(index): void`
- [x] Add `setMaxHeight(height: number): void`

Closes #618
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement new-mdc-feature Feature incorporated from material-components-web
Projects
None yet
Development

No branches or pull requests

1 participant