Only catch event inside color wheel (#16890)

This commit is contained in:
Paul Bottein 2023-06-13 17:21:01 +02:00 committed by GitHub
parent f8ea7e0ef2
commit 9875cb2723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -373,17 +373,19 @@ class HaHsColorPicker extends LitElement {
return css` return css`
:host { :host {
display: block; display: block;
outline: none;
} }
.container { .container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer;
display: flex; display: flex;
} }
canvas { canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%;
cursor: pointer;
} }
svg { svg {
position: absolute; position: absolute;

View File

@ -381,21 +381,22 @@ class HaTempColorPicker extends LitElement {
:host { :host {
display: block; display: block;
outline: none; outline: none;
border-radius: 9999px;
}
:host(:focus-visible) {
box-shadow: 0 0 0 2px rgb(255, 160, 0);
} }
.container { .container {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer;
display: flex; display: flex;
} }
canvas { canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%;
transition: box-shadow 180ms ease-in-out;
cursor: pointer;
}
:host(:focus-visible) canvas {
box-shadow: 0 0 0 2px rgb(255, 160, 0);
} }
svg { svg {
position: absolute; position: absolute;