mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-30 08:17:20 +00:00
Tweak ha-form (#10194)
This commit is contained in:
parent
588ee2c3b1
commit
ad031d4bda
@ -24,6 +24,7 @@ export class HaFormFloat extends LitElement implements HaFormElement {
|
|||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<mwc-textfield
|
<mwc-textfield
|
||||||
|
inputMode="decimal"
|
||||||
.label=${this.label}
|
.label=${this.label}
|
||||||
.value=${this.data !== undefined ? this.data : ""}
|
.value=${this.data !== undefined ? this.data : ""}
|
||||||
.required=${this.schema.required}
|
.required=${this.schema.required}
|
||||||
|
@ -63,6 +63,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
|
|||||||
return html`
|
return html`
|
||||||
<mwc-textfield
|
<mwc-textfield
|
||||||
type="number"
|
type="number"
|
||||||
|
inputMode="numeric"
|
||||||
.label=${this.label}
|
.label=${this.label}
|
||||||
.value=${this.data !== undefined ? this.data : ""}
|
.value=${this.data !== undefined ? this.data : ""}
|
||||||
.required=${this.schema.required}
|
.required=${this.schema.required}
|
||||||
|
@ -101,8 +101,6 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
|
|||||||
this.shadowRoot?.querySelector("mwc-textfield") || ({} as any);
|
this.shadowRoot?.querySelector("mwc-textfield") || ({} as any);
|
||||||
if (formElement) {
|
if (formElement) {
|
||||||
formElement.style.textOverflow = "ellipsis";
|
formElement.style.textOverflow = "ellipsis";
|
||||||
formElement.style.cursor = "pointer";
|
|
||||||
formElement.setAttribute("readonly", "");
|
|
||||||
}
|
}
|
||||||
if (mdcRoot) {
|
if (mdcRoot) {
|
||||||
mdcRoot.style.cursor = "pointer";
|
mdcRoot.style.cursor = "pointer";
|
||||||
@ -162,10 +160,17 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
|
|||||||
:host([own-margin]) {
|
:host([own-margin]) {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
ha-button-menu,
|
ha-button-menu {
|
||||||
mwc-textfield,
|
display: block;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
mwc-formfield {
|
mwc-formfield {
|
||||||
display: block;
|
display: block;
|
||||||
|
padding-right: 16px;
|
||||||
|
}
|
||||||
|
mwc-textfield {
|
||||||
|
display: block;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
ha-svg-icon {
|
ha-svg-icon {
|
||||||
color: var(--input-dropdown-icon-color);
|
color: var(--input-dropdown-icon-color);
|
||||||
|
@ -119,6 +119,7 @@ export class PaperTimeInput extends PolymerElement {
|
|||||||
<paper-input
|
<paper-input
|
||||||
id="hour"
|
id="hour"
|
||||||
type="number"
|
type="number"
|
||||||
|
inputmode="numeric"
|
||||||
value="{{hour}}"
|
value="{{hour}}"
|
||||||
label="[[hourLabel]]"
|
label="[[hourLabel]]"
|
||||||
on-change="_shouldFormatHour"
|
on-change="_shouldFormatHour"
|
||||||
@ -141,6 +142,7 @@ export class PaperTimeInput extends PolymerElement {
|
|||||||
class$="[[_computeClassNames(enableSecond)]]"
|
class$="[[_computeClassNames(enableSecond)]]"
|
||||||
id="min"
|
id="min"
|
||||||
type="number"
|
type="number"
|
||||||
|
inputmode="numeric"
|
||||||
value="{{min}}"
|
value="{{min}}"
|
||||||
label="[[minLabel]]"
|
label="[[minLabel]]"
|
||||||
on-change="_formatMin"
|
on-change="_formatMin"
|
||||||
@ -163,6 +165,7 @@ export class PaperTimeInput extends PolymerElement {
|
|||||||
class$="[[_computeClassNames(enableMillisecond)]]"
|
class$="[[_computeClassNames(enableMillisecond)]]"
|
||||||
id="sec"
|
id="sec"
|
||||||
type="number"
|
type="number"
|
||||||
|
inputmode="numeric"
|
||||||
value="{{sec}}"
|
value="{{sec}}"
|
||||||
label="[[secLabel]]"
|
label="[[secLabel]]"
|
||||||
on-change="_formatSec"
|
on-change="_formatSec"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user