Skip to content

Commit

Permalink
fix(texfield): update textfield adapters as per mdc 0.29.0
Browse files Browse the repository at this point in the history
Text field outline adapter now must implement the getIdleOutlineStyleValue method previously
implemented in the text field adapter.
  • Loading branch information
stasson committed Jan 23, 2018
1 parent 6d2bdd8 commit d565a31
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions components/textfield/mdc-textfield.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<path class="mdc-text-field__outline-path" :d="outlinePathAttr" />
</svg>
</div>
<div class="mdc-text-field__idle-outline" v-if="hasOutline"></div>
<div ref="outlineIdle" class="mdc-text-field__idle-outline" v-if="hasOutline"></div>
<div ref="bottom" :class="bottomClasses" v-if="hasBottomLine"></div>

</div>
Expand Down Expand Up @@ -286,6 +286,13 @@ export default {
setOutlinePathAttr: (value) => {
this.outlinePathAttr = value
},
getIdleOutlineStyleValue: (propertyName) => {
const idleOutlineElement = this.$refs.outlineIdle;
if (idleOutlineElement) {
return window.getComputedStyle(idleOutlineElement)
.getPropertyValue(propertyName);
}
},
})
this.outlineFoundation.init()
}
Expand Down Expand Up @@ -316,12 +323,6 @@ export default {
this.$refs.bottom.removeEventListener(evtType, handler);
}
},
getIdleOutlineStyleValue: (propertyName) => {
const idleOutlineElement = this.$refs.outline
if (idleOutlineElement) {
return window.getComputedStyle(idleOutlineElement).getPropertyValue(propertyName);
}
},
isFocused: () => {
return document.activeElement === this.$refs.input
},
Expand Down

0 comments on commit d565a31

Please sign in to comment.