MelleD / lovelace-expander-card

Expander card for HomeAssistant
Apache License 2.0
23 stars 4 forks source link

Add min-width and max-width options #151

Closed M4TH1EU closed 3 weeks ago

M4TH1EU commented 3 weeks ago

Hi 👋🏻

This PR adds support for the feature requested in #140 by @S1M8N.

Your latest commits with the listener seems to have magically fixed the only bug I had with the card not being expandable when the screen size changed, go figure hahaha.

This PR adds 2 settings in the editor, min-width and max-width. They must be used along the start expanded toggle. If a min-width is specified, the card will only open when the screen width is >= to that value. Same goes for max-width, the card will only open when the screen width is <= to that value. They can be set individually or both at the same time.

If none are set, the behaviour of start expanded is not changed.

I've also changed the type from string to number as reported in the request.

I'll let you test and report if you have any questions/improvements in mind :)

Have a great day 🎉

Fix #140

MelleD commented 3 weeks ago

Thanks for the first PR @M4TH1EU :)

Quick question whether I understood it 100% correctly. It's about what width does the card open automatically? Example min width is 300 i.e. if the device has 300 pixels the card is initially open, but it can be opened and closed as normal, correct?

Looks good for me so far, you need to use camelCase for the attributes see comments

github-actions[bot] commented 3 weeks ago

Release 1.3.0 addresses this.

github-actions[bot] commented 3 weeks ago

Release 1.3.0 addresses this.