Fix automation editor safari (#1576)

* Use ha-textarea

* Lower Safari requirement to 10.3

* Lint
This commit is contained in:
Paulus Schoutsen
2018-08-16 21:49:35 +02:00
committed by GitHub
parent 488e6d09ca
commit 9f71d9331c
9 changed files with 73 additions and 27 deletions

View File

@@ -0,0 +1,43 @@
/*
Wrapper for paper-textarea.
paper-textarea crashes on iOS when created programmatically. This only impacts
our automation and script editors as they are using Preact. Polymer is using
template elements and does not have this issue.
paper-textarea issue: https://github.com/PolymerElements/paper-input/issues/556
WebKit issue: https://bugs.webkit.org/show_bug.cgi?id=174629
*/
import '@polymer/paper-input/paper-textarea.js';
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
class HaTextarea extends PolymerElement {
static get template() {
return html`
<style>
:host {
display: block;
}
</style>
<paper-textarea
label='[[label]]'
value='{{value}}'
></paper-textarea>
`;
}
static get properties() {
return {
label: String,
value: {
type: String,
notify: true,
}
};
}
}
customElements.define('ha-textarea', HaTextarea);