-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create spacer chip #1098
create spacer chip #1098
Conversation
if (!this.hass || !this._config) { | ||
return html`<div></div>`; | ||
} | ||
|
||
return html`<div></div>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't seem to have any effect, would probably drop it.
if (!this.hass || !this._config) { | |
return html`<div></div>`; | |
} | |
return html`<div></div>`; | |
return html`<div></div>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, hass and config are not used, we don't need these attributes in the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello. I like the idea. It can be very useful.
Thanks's for your contribution. The code need to be cleaned because there is many unused code in the editor and the chip.
Also, the documentation is missing.
<ha-form | ||
.hass=${this.hass} | ||
.data=${this._config} | ||
.schema=${schema} | ||
.computeLabel=${this._computeLabel} | ||
@value-changed=${this._valueChanged} | ||
></ha-form> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this because it's not needed.
private _computeLabel = (schema: HaFormSchema) => { | ||
const customLocalize = setupCustomlocalize(this.hass!); | ||
|
||
if (GENERIC_LABELS.includes(schema.name)) { | ||
return customLocalize(`editor.card.generic.${schema.name}`); | ||
} | ||
return this.hass!.localize(`ui.panel.lovelace.editor.card.generic.${schema.name}`); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this because it's not needed.
import { SpacerChipConfig } from "../../../utils/lovelace/chip/types"; | ||
import { LovelaceChipEditor } from "../../../utils/lovelace/types"; | ||
|
||
const computeSchema = memoizeOne((): HaFormSchema[] => []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this because it's not needed.
<div style="margin-top: 20px;">There are currently no config options for this chip.</div> | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be translated.
if (!this.hass || !this._config) { | ||
return html`<div></div>`; | ||
} | ||
|
||
return html`<div></div>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, hass and config are not used, we don't need these attributes in the component.
Sorry, I left the config and form stuff in because I wasn't sure if some config options would be wanted. I removed the unused code except the setConfig function as it is required on interface LovelaceChip. I'm not sure what is best to do with that. I added docs and an English translation |
Yes, we can remove the editor and the edit button 😊 |
I updated to the last version but I dont see SPACER available? Why? v2.7.0 |
Same issues. I don't see spacer available in safari or iOS companion app. It does show in chrome and I can add it in chrome and it behaves correctly. When going back to chrome or iOS it does not work. |
Description
I added a spacer chip to the chips card. Just a div element with flex-grow. currently no configuration options but setting custom sizes could be added.
Related Issue
This PR fixes or closes issue: fixes #1096
Motivation and Context
Seems like a good idea to have spacers in the chips card
How Has This Been Tested
Tested in Firefox, Chrome, Edge, Companion App(iOS)
Types of changes
Checklist