Skip to content

Commit

Permalink
Merge pull request #70 from regevbr/popup
Browse files Browse the repository at this point in the history
fix mobile popup menus
  • Loading branch information
regevbr authored Mar 13, 2022
2 parents 99c0cd8 + 262dc07 commit 465b684
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ v2 is only compatible from version 2022.3 onwards

```yaml
resources:
- url: /local/mini-climate-card-bundle.js?v=2.0.0
- url: /local/mini-climate-card-bundle.js?v=2.0.1
type: module
```
Expand All @@ -35,14 +35,14 @@ v2 is only compatible from version 2022.3 onwards
2. Grab `mini-climate-card-bundle.js`

```console
$ wget https://github.com/artem-sedykh/mini-climate-card/releases/download/v2.0.0/mini-climate-card-bundle.js
$ wget https://github.com/artem-sedykh/mini-climate-card/releases/download/v2.0.1/mini-climate-card-bundle.js
```

3. Add a reference to `mini-climate-card-bundle.js` inside your `ui-lovelace.yaml`.

```yaml
resources:
- url: /local/mini-climate-card-bundle.js?v=2.0.0
- url: /local/mini-climate-card-bundle.js?v=2.0.1
type: module
```

Expand All @@ -55,7 +55,7 @@ v2 is only compatible from version 2022.3 onwards

```yaml
resources:
- url: /local/mini-climate-card-bundle.js?v=2.0.0
- url: /local/mini-climate-card-bundle.js?v=2.0.1
type: module
```

Expand Down
5 changes: 2 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-climate-card",
"version": "v2.0.0",
"version": "v2.0.1",
"description": "a/c card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
6 changes: 6 additions & 0 deletions release_notes/v2.0.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## v2.0.1
[![Downloads](https://img.shields.io/github/downloads/artem-sedykh/mini-climate-card/v2.0.1/total.svg)](https://github.com/artem-sedykh/mini-climate-card/releases/tag/v2.0.1)

### FIXED
- fix: mobile popup issues by @regevbr

2 changes: 1 addition & 1 deletion src/components/dropdown-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class ClimateDropdownBase extends ScopedRegistryHost(LitElement)
?color=${this.active}>
<ha-icon .icon=${this.icon}></ha-icon>
</ha-icon-button>
<mwc-menu fixed
<mwc-menu absolute
id=${'menu'}
?quick=${true}
.menuCorner=${'END'}
Expand Down
2 changes: 1 addition & 1 deletion src/components/fan-mode-secondary.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class ClimateFanModeSecondary extends ScopedRegistryHost(LitEleme
>
${this.renderFanMode()}
</ha-icon-button>
<mwc-menu fixed
<mwc-menu absolute
id=${'menu'}
?quick=${true}
.menuCorner=${'END'}
Expand Down
10 changes: 9 additions & 1 deletion src/components/mwc/menu-surface.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MenuSurfaceBase } from '@material/mwc-menu/mwc-menu-surface-base';
import { styles as menuSurfaceStyles } from '@material/mwc-menu/mwc-menu-surface.css';
import { ScopedRegistryHost } from '@lit-labs/scoped-registry-mixin';
import { css } from 'lit';
import buildElementDefinitions from '../../utils/buildElementDefinitions';

export default class ClimateMenuSurface extends ScopedRegistryHost(MenuSurfaceBase) {
Expand All @@ -11,6 +12,13 @@ export default class ClimateMenuSurface extends ScopedRegistryHost(MenuSurfaceBa
}

static get styles() {
return menuSurfaceStyles;
return [
menuSurfaceStyles,
css`
.mdc-menu-surface {
position: fixed!important;
}
`,
];
}
}

0 comments on commit 465b684

Please sign in to comment.