Fix calendar toggle group wrapping (#27049)

This commit is contained in:
Aidan Timson
2025-09-15 15:12:37 +01:00
committed by GitHub
parent 98e6f32fe8
commit 9d02a1d391
2 changed files with 9 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ export class HaButtonToggleGroup extends LitElement {
@property({ reflect: true }) size: "small" | "medium" = "medium"; @property({ reflect: true }) size: "small" | "medium" = "medium";
@property({ type: Boolean, reflect: true, attribute: "no-wrap" })
public nowrap = false;
@property() public variant: @property() public variant:
| "brand" | "brand"
| "neutral" | "neutral"
@@ -71,6 +74,10 @@ export class HaButtonToggleGroup extends LitElement {
:host { :host {
--mdc-icon-size: var(--button-toggle-icon-size, 20px); --mdc-icon-size: var(--button-toggle-icon-size, 20px);
} }
:host([no-wrap]) wa-button-group::part(base) {
flex-wrap: nowrap;
}
`; `;
} }

View File

@@ -162,6 +162,7 @@ export class HAFullCalendar extends LitElement {
.buttons=${viewToggleButtons} .buttons=${viewToggleButtons}
.active=${this._activeView} .active=${this._activeView}
size="small" size="small"
no-wrap
@value-changed=${this._handleView} @value-changed=${this._handleView}
></ha-button-toggle-group> ></ha-button-toggle-group>
` `
@@ -197,6 +198,7 @@ export class HAFullCalendar extends LitElement {
.buttons=${viewToggleButtons} .buttons=${viewToggleButtons}
.active=${this._activeView} .active=${this._activeView}
size="small" size="small"
no-wrap
@value-changed=${this._handleView} @value-changed=${this._handleView}
></ha-button-toggle-group> ></ha-button-toggle-group>
</div> </div>