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

chore(text-field): Move idle outline style method #1911

Merged
merged 4 commits into from
Jan 9, 2018

Conversation

patrickrodee
Copy link
Contributor

@patrickrodee patrickrodee commented Jan 9, 2018

Remove getIdleOutlineStyleValue method from textfield adapter. Add
getIdleOutlineStyleValue method to textfield outline adapter. Update
tests to check new functionality.

BREAKING CHANGE: Text field outline adapter now must implement the getIdleOutlineStyleValue method previously implemented in the text field adapter. The functionality is exactly the same and requires only small changes to accessing the outline node.

Remove `getIdleOutlineStyleValue` method from textfield adapter. Add
`getIdleOutlineStyleValue` method to textfield outline adapter. Update
tests to check new functionality.
@@ -52,6 +52,12 @@ class MDCTextFieldOutline extends MDCComponent {
const path = this.root_.querySelector(strings.PATH_SELECTOR);
path.setAttribute('d', value);
},
getIdleOutlineStyleValue: (propertyName) => {
const idleOutlineElement = this.root_.parentNode.querySelector(strings.IDLE_OUTLINE_SELECTOR);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only real funkiness. Since the idle outline is a sibling of the outline root, we need to access the parent node to be able to query it.

Copy link
Contributor

@lynnmercier lynnmercier left a comment

Choose a reason for hiding this comment

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

LGTM!

Remove getIdleOutlineStyleValue from textfield foundation default
adapter and test cases
Remove the extraneous `getIdleOutlineStyleValue` from text field
foundation default adapter.
@codecov-io
Copy link

codecov-io commented Jan 9, 2018

Codecov Report

Merging #1911 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1911   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files          84       84           
  Lines        3721     3721           
  Branches      484      484           
=======================================
  Hits         3700     3700           
  Misses         21       21
Impacted Files Coverage Δ
packages/mdc-textfield/constants.js 100% <ø> (ø) ⬆️
packages/mdc-textfield/outline/constants.js 100% <ø> (ø) ⬆️
packages/mdc-textfield/index.js 96.42% <ø> (-0.13%) ⬇️
packages/mdc-textfield/foundation.js 98.19% <100%> (-0.05%) ⬇️
packages/mdc-textfield/outline/index.js 93.33% <100%> (+2.42%) ⬆️
packages/mdc-textfield/outline/foundation.js 87.5% <100%> (+2.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 302349e...6235496. Read the comment docs.

@patrickrodee patrickrodee merged commit 5d3b350 into master Jan 9, 2018
patrickrodee added a commit that referenced this pull request Jan 9, 2018
Remove `getIdleOutlineStyleValue` method from text field adapter as it
was unused following the merge of #1911
patrickrodee added a commit that referenced this pull request Jan 9, 2018
Remove `getIdleOutlineStyleValue` method from text field adapter as it
was unused following the merge of #1911
@kfranqueiro kfranqueiro deleted the fix/textfield/idle-outline-styles branch April 24, 2018 17:15
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.

3 participants