Set attributes in input form controls (#1805)

* 🔨 add autocapitalize, autocomplete, autocorrect and spellcheck attributes

* 🔨 switch autocapitalize to none

* 🔨 add attributes to dev-state

* 🔨 add attributes to entity-picker
This commit is contained in:
Timmo 2018-10-19 08:13:45 +01:00 committed by Paulus Schoutsen
parent d97e356376
commit 028003dffc
3 changed files with 25 additions and 2 deletions

View File

@ -38,7 +38,16 @@ class HaEntityPicker extends EventsMixin(LocalizeMixin(PolymerElement)) {
allow-custom-value="[[allowCustomEntity]]"
on-change='_fireChanged'
>
<paper-input autofocus="[[autofocus]]" label="[[_computeLabel(label, localize)]]" class="input" value="[[value]]" disabled="[[disabled]]">
<paper-input
autofocus="[[autofocus]]"
label="[[_computeLabel(label, localize)]]"
class="input"
autocapitalize='none'
autocomplete='off'
autocorrect='off'
spellcheck='false'
value="[[value]]"
disabled="[[disabled]]">
<paper-icon-button slot="suffix" class="clear-button" icon="hass:close" no-ripple="" hidden$="[[!value]]">Clear</paper-icon-button>
<paper-icon-button slot="suffix" class="toggle-button" icon="[[_computeToggleIcon(opened)]]" hidden="[[!_states.length]]">Toggle</paper-icon-button>
</paper-input>

View File

@ -120,6 +120,10 @@ class HaPanelDevService extends PolymerElement {
always-float-label
label='Service Data (JSON, optional)'
value='{{serviceData}}'
autocapitalize='none'
autocomplete='off'
autocorrect='off'
spellcheck='false'
></paper-textarea>
<paper-button
on-click='_callService'

View File

@ -91,10 +91,20 @@ class HaPanelDevState extends EventsMixin(PolymerElement) {
<paper-input
label="State"
required
autocapitalize='none'
autocomplete='off'
autocorrect='off'
spellcheck='false'
value='{{_state}}'
class='state-input'
></paper-input>
<paper-textarea label="State attributes (JSON, optional)" value='{{_stateAttributes}}'></paper-textarea>
<paper-textarea
label="State attributes (JSON, optional)"
autocapitalize='none'
autocomplete='off'
autocorrect='off'
spellcheck='false'
value='{{_stateAttributes}}'></paper-textarea>
<paper-button on-click='handleSetState' raised>Set State</paper-button>
</div>