I have a use case for the built in Shopping list integration where our family members can all contribute to our Thanksgiving dinner. Family members can select the dish that they want to bring by including their name on the item of their choice and then click on the checkbox. This is working well. The problem is that I do not want them to inadvertently click on the ‘Clear checked items’ button as this will delete those items. I can delete them myself with a service call.
I have spent hours trying to use custom js code to disable or hide that button to no avail. I have also tried card-mod and also modifying the shopping list integration as a custom_component with no success as my programming skills are limited. I don’t need to submit a FR as I see this as a limited use case. Any ideas are appreciated.
brewston
(Tim Jones)
September 22, 2023, 2:36pm
2
I saw someone else complain about that - Shopping list deleted with one icon? - #3 by megapint - I guess I didn’t understand the use case. Yours makes sense.
You could (But I’ve not tried) have one card which displays the list and another which takes a text input and then adds that item to the list. And not actually use the shopping list card.
Actually I have the first one :
type: custom:mushroom-entity-card
entity: sensor.shopping_list
icon: fas:shopping-basket
name: ' '
card_mod:
style: |
ha-card
{
--chip-font-size: 0.8em;
--chip-height: 50px;
}
Thanks for the idea but I do like all of the shopping list features like add, edit, remove items which I would have to recreate.
I have found a way to do this with card-mod that works perfectly as follows:
type: shopping-list
card_mod:
style: |
:host .clearall {
color: var(--disabled-text-color);
--paper-item-icon-color: var(--disabled-text-color);
pointer-events: none;
}
brewston
(Tim Jones)
September 22, 2023, 3:32pm
5
@megapint ^^^ lookee here ^^^
1 Like
EDIT: This requires the following to be installed in Home Assistant:
HACS
card-mod, using HACS interface.
Thanks, this absolutely does the trick. And the card-mod looks like a powerful option foor me to play around with!
Cheers
This worked for me, after 2024.2, added section ha-card.type-todo-list div.header
:
My full card-mod configuration, with line spacing “corrected” to my likings:
card_mod:
style:
ha-textfield:
$: |
.mdc-text-field {
margin-top: -28px;
margin-bottom: 5px;
height: 50px !important;
}
.mdc-text-field__input {
color: white !important;
}
.: |
ha-card.type-todo-list div.header {
display: none;
}
ha-check-list-item.editRow.completed {
display: none;
}
:host {
--mdc-checkbox-ripple-size: 33px;
}
ha-check-list-item {
min-height: 28px !important;
}
ha-card {
--mdc-typography-subtitle1-font-size: 17px;
}
ha-icon-button.reorderButton,
ha-icon-button.addButton {
margin-top: -35px !important;
}
.divider {
display: none;
}
Thanks!
wendevlin
(Wendelin)
October 11, 2024, 8:27am
8
Hi,
there will be an option in 2024.11:
home-assistant:dev
← home-assistant:todo-list-card-hide-completed
opened 06:30PM - 10 Oct 24 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
- Added option for todo-list-card to hide the completed items
![image](https://github.com/user-attachments/assets/3479dbf9-ede6-43ce-a512-f76cd6b991ed)
![image](https://github.com/user-attachments/assets/e2df9a5d-d44d-4673-9139-c22c43ab1a31)
## Type of change
<!--
What type of change does your PR introduce to the Home Assistant frontend?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (thank you!)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Example configuration
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR.
-->
```yaml
type: todo-list
entity: todo.shopping_list
hide_completed: true
```
## Additional information
- This PR is related to issue or discussion:
- https://community.home-assistant.io/t/have-an-option-to-hide-checked-items-on-the-todo-list-card/655424/8
- https://community.home-assistant.io/t/shopping-list-how-to-disable-hide-the-clear-completed-button-icon/617372
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/35170
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
<!--
Thank you for contributing <3
-->
[docs-repository]: https://github.com/home-assistant/home-assistant.io