Fix more info slider in iOS (#20586)

This commit is contained in:
Paul Bottein 2024-04-22 18:26:50 +02:00 committed by GitHub
parent a3090796d2
commit 62f46baacf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 18 additions and 2 deletions

View File

@ -67,6 +67,9 @@ export class HaControlSlider extends LitElement {
@property({ attribute: "tooltip-mode" })
public tooltipMode: TooltipMode = "interaction";
@property({ attribute: "touch-action" })
public touchAction?: string;
@property({ type: Number })
public value?: number;
@ -152,7 +155,7 @@ export class HaControlSlider extends LitElement {
setupListeners() {
if (this.slider && !this._mc) {
this._mc = new Manager(this.slider, {
touchAction: this.vertical ? "pan-x" : "pan-y",
touchAction: this.touchAction ?? (this.vertical ? "pan-x" : "pan-y"),
});
this._mc.add(
new Pan({

View File

@ -33,6 +33,9 @@ export class HaControlSwitch extends LitElement {
// SVG icon path (if you need a non SVG icon instead, use the provided off icon slot to pass an <ha-icon slot="icon-off"> in)
@property({ type: String }) pathOff?: string;
@property({ attribute: "touch-action" })
public touchAction?: string;
private _mc?: HammerManager;
protected firstUpdated(changedProperties: PropertyValues): void {
@ -73,7 +76,7 @@ export class HaControlSwitch extends LitElement {
setupListeners() {
if (this.switch && !this._mc) {
this._mc = new Manager(this.switch, {
touchAction: this.vertical ? "pan-x" : "pan-y",
touchAction: this.touchAction ?? (this.vertical ? "pan-x" : "pan-y"),
});
this._mc.add(
new Swipe({

View File

@ -78,6 +78,7 @@ class LightColorTempPicker extends LitElement {
return html`
<ha-control-slider
touch-action="none"
inverted
vertical
.value=${this._ctPickerValue}

View File

@ -41,6 +41,7 @@ export class HaStateControlCoverPosition extends LitElement {
return html`
<ha-control-slider
touch-action="none"
vertical
.value=${this.value}
min="0"

View File

@ -78,6 +78,7 @@ export class HaStateControlInfoCoverTiltPosition extends LitElement {
return html`
<ha-control-slider
touch-action="none"
vertical
.value=${this.value}
min="0"

View File

@ -106,6 +106,7 @@ export class HaStateControlCoverToggle extends LitElement {
return html`
<ha-control-switch
touch-action="none"
vertical
reversed
.checked=${isOn}

View File

@ -111,6 +111,7 @@ export class HaStateControlFanSpeed extends LitElement {
return html`
<ha-control-slider
touch-action="none"
vertical
min="0"
max="100"

View File

@ -108,6 +108,7 @@ export class HaStateControlToggle extends LitElement {
return html`
<ha-control-switch
touch-action="none"
.pathOn=${this.iconPathOn || mdiFlash}
.pathOff=${this.iconPathOff || mdiFlashOff}
vertical

View File

@ -59,6 +59,7 @@ export class HaStateControlLightBrightness extends LitElement {
return html`
<ha-control-slider
touch-action="none"
vertical
.value=${this.value}
min="1"

View File

@ -118,6 +118,7 @@ export class HaStateControlLockToggle extends LitElement {
return html`
<ha-control-switch
touch-action="none"
vertical
reversed
.checked=${this._isOn}

View File

@ -40,6 +40,7 @@ export class HaStateControlValvePosition extends LitElement {
return html`
<ha-control-slider
touch-action="none"
vertical
.value=${this.value}
min="0"

View File

@ -106,6 +106,7 @@ export class HaStateControlValveToggle extends LitElement {
return html`
<ha-control-switch
touch-action="none"
vertical
reversed
.checked=${isOn}