Comments (6)
I can confirm the same behavior:
This is in the Android app, so they aren't cut off (because the sidebar is expanded), but I am definitely having that badge on all my custom items.
from custom-sidebar-v2.
Correction: This is behaving slightly differently for me on PC (Chrome) that in is in the Android app.
It isn't showing on every single custom icon, but it is on a couple, so I'm not sure what's the determining factor.
from custom-sidebar-v2.
@galloween Any ideas on how to solve this?
from custom-sidebar-v2.
This was bothering me. I can submit a PR but I haven't been seeing much communication or activity on this repo by the author so it might go unmerged. (Edit - never mind, clearly wasn't looking in the right place! @galloween Let me know if you'd like me to submit a PR, or if you'd rather address this a different way)
The problem is that when you add a new item it clones an existing item, modifies it, then appends it. If the cloned item has a badge, the new item will too.
Here's my fix:
-
Edit your custom-sidebar-v2/custom-sidebar-v2.js file (I'm using HACS and mine was in www/community)
-
Find the
function createItem
(should be around line 277) -
Anywhere in the
if (cln) {}
block, add this:
if (config_entry.new_item) {
// If the cloned item has a configuration badge, remove it.
cln.querySelector(".configuration-badge")?.remove();
}
This will ensure any items that you're adding (instead of moving around) will not have the number badge.
Side note: I struggled with getting Home Assistant to serve up a current version of the custom-sidebar-v2.js file instead of feeding me a cached copy (tried hard refreshing, clearing cache, restarting HA; always got the original copy). I ended up changing the .js filename (and updating the reference in my configuration.yaml's extra_module_url
). If someone could tell me how to actually clear the cache for that I'd appreciate it! I'm using HACS which might have something to do with it.
Second edit: Re-reading the original message in this issue, I'm wondering if this can happen to folks even when an item isn't flagged with "new_item": true. If this is the case, we could instead add another option to the entry items such as "badge": false. Just a thought.
from custom-sidebar-v2.
I just added your forked repo.
I think it only shows on "new_item". But will test it and see if it is showing on all the entries.
from custom-sidebar-v2.
@ianwitherow do you plan to maintain your fork? 😄
This breaks on the latest HA release (2023.4)
from custom-sidebar-v2.
Related Issues (17)
- iframe support? HOT 2
- Admin Exception
- Plugin not working for non-admin users HOT 4
- Add "defaultPanel" configuration setting
- Order not respected in mobile app HOT 1
- Ctrl + f5 makes this custom sidebar not work?
- Not working in latest chrome / ha HOT 1
- Configuration badge (notification) are repeated on all new items HOT 3
- Not working on latest HassOS
- App Configuration on iOS device HOT 1
- Does not work on HA release 2023.4 HOT 15
- Sidebar never updates HOT 4
- Exceptions do not hide items HOT 10
- Tooltips
- Fast loading HOT 3
- Icons not showing for new_item HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from custom-sidebar-v2.