Skip to content

Commit

Permalink
Fix: Highlighting of label now works
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro La Bella [fabbricadigitale] committed Jul 27, 2017
1 parent 5d6868a commit 5f30074
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions paper-chip-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
display: none;
}



:host #fakeInputContainer {
--paper-input-container-underline: {
display: none;
Expand All @@ -134,15 +132,14 @@
</style>

<paper-input-container id="fakeInputContainer" no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]">
<div container slot="prefix">
</div>
<div container slot="prefix"></div><!-- We use prefix to preserve correct height -->
<label id="label" hidden$="[[!label]]" slot="label" for="fakeInput">[[label]]</label>
<iron-input slot="input" bind-value="{{_fakeValue}}">
<iron-input slot="input" bind-value="[[_fakeValue]]">
<input disabled id="fakeInput" type="text" value="{{value::input}}">
</iron-input>
</paper-input-container>

<paper-input-container id="tags">
<paper-input-container id="tags" focused="{{_focused}}">
<div container slot="prefix">
<dom-repeat items="[[values]]" as="item">
<template>
Expand Down Expand Up @@ -258,7 +255,7 @@
static get observers() {
return [
"_onValuesChanged(values, values.splices)",
"_onContentOrValuesChanges(_hasContent)"
"_onContentOrValuesChanges(_hasContent, _focused)"
];
}

Expand All @@ -269,8 +266,9 @@
}
}

_onContentOrValuesChanges(hasValuesOrContent) {
_onContentOrValuesChanges(hasValuesOrContent, _isFocused) {
this._fakeValue = hasValuesOrContent ? " " : ""
this.$.fakeInputContainer._setFocused(_isFocused)
return this._fakeValue
}

Expand Down

0 comments on commit 5f30074

Please sign in to comment.