Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(select): Add value retrieval mechanisms to JS API #353

Merged
merged 2 commits into from
Feb 27, 2017

Conversation

traviskaufman
Copy link
Contributor

  • Add value property to JS component to retrieve the value of the
    currently selected option
  • Add getValue() method to foundation in order to drive value
    property in component.
  • Add getValueForOptionAtIndex foundation method.
  • Enhance verifyDefaultAdapter foundation test helper by making it so
    that when checking for correct adapter methods, the method names don't
    have to be in the same order as they are defined on the object.

BREAKING CHANGE: New adapter method: getValueForOptionAtIndex(index: string) => string
should return the "value" of the option at the given index. Please add
this method to your adapter implementations.

Resolves #232

@@ -293,6 +297,10 @@ within `componentDidUpdate`.

### The full foundation API

#### MDCSelectFoundation.getValue() => string

Returns the value of the currently selected option.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also document when invalid what happens if user haven't made any choice.

"Returns the value of the currently selected option. If none of options is selected yet, return empty string."

- Add `value` property to JS component to retrieve the value of the
  currently selected option
- Add `getValue()` method to foundation in order to drive `value`
  property in component.
- Add `getValueForOptionAtIndex` foundation method.
- Enhance `verifyDefaultAdapter` foundation test helper by making it so
  that when checking for correct adapter methods, the method names don't
  have to be in the same order as they are defined on the object.

BREAKING CHANGE: **New adapter method:** `getValueForOptionAtIndex(index: string) => string`
should return the "value" of the option at the given index. Please add
this method to your adapter implementations.

Resolves #232
@traviskaufman traviskaufman force-pushed the feat/select-value-property branch from 529f176 to 279ba99 Compare February 27, 2017 20:51
@traviskaufman
Copy link
Contributor Author

@yeelan0319 changes made PTAL 👀

@traviskaufman traviskaufman merged commit a55bbc5 into master Feb 27, 2017
@traviskaufman traviskaufman deleted the feat/select-value-property branch February 27, 2017 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants