Closed mwasowski closed 4 years ago
This is just how websites work, if you click something it gets focus.
I have to disagree or maybe I'll rephrase. The 'loosing focus' is referring to the visual aspect. The animation looks like it's stuck half way through with the round shadow around the control.
@bramkragten Why this was closed without even taking into consideration or allowing me to explain. This is a bug, maybe visual one but it is.
We just use and follow material elements/guidelines. We are not going to make changes to the behaviour of those elements.
You can create an issue upstream if you disagree.
Ok, this indeed might be a correct implementation according to Material Design Guidelines. This is just beyond me, I did not think that it might be the case: That's from: https://material-components.github.io/material-components-web-catalog/#/component/switch it behaves the same way HA toggle does.
So you were right, I think I just never realized this and never encountered this, maybe because I have more experience with Material Design in Angular and there it behaves as I was expecting, the ripple effect disappears after the action finishes: That's from: https://material.angular.io/components/slide-toggle/overview
Sorry for opening another issue, but I was genuinely triggered. I cooled down a bit ;)
Checklist
The problem
I noticed recently that when I click an entity in card group (or single entity for that matter), the element keeps focus until anything else is clicked making it loose focus as seen on the example:
Expected behavior
When the toggle is clicked the entity looses focus.
Steps to reproduce
Environment
State of relevant entities
It's not relevant to specific entity but I noticed it after I added this.
Problem-relevant configuration
Javascript errors shown in your browser console/inspector
Additional information