From 6dbfbc43da48b2171d3948281d3d4f8332c6e97b Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 25 Sep 2024 14:37:47 +0200 Subject: [PATCH] fix(checkbox): use sibling css selector instead of has This makes the checkbox work as intended on older browsers which do not support the :has selector. Resolves https://kolaente.dev/vikunja/vikunja/issues/2713 (cherry picked from commit 15d95f16da86d57edd02dbe09fd3b55e185b75d9) --- frontend/src/components/base/BaseCheckbox.vue | 37 ++++++------------- .../src/components/input/FancyCheckbox.vue | 9 ++--- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/frontend/src/components/base/BaseCheckbox.vue b/frontend/src/components/base/BaseCheckbox.vue index 39c42dec8..2a3c40547 100644 --- a/frontend/src/components/base/BaseCheckbox.vue +++ b/frontend/src/components/base/BaseCheckbox.vue @@ -3,33 +3,22 @@ v-cy="'checkbox'" class="base-checkbox" > - - - - - + + \ No newline at end of file diff --git a/frontend/src/components/input/FancyCheckbox.vue b/frontend/src/components/input/FancyCheckbox.vue index 18dd78b69..9118afdb0 100644 --- a/frontend/src/components/input/FancyCheckbox.vue +++ b/frontend/src/components/input/FancyCheckbox.vue @@ -38,7 +38,6 @@ const emit = defineEmits<{ }>() - @@ -80,13 +79,13 @@ const emit = defineEmits<{ // Since css-has-pseudo doesn't work with deep classes, // the following rules can't be scoped -.fancy-checkbox:has(:not(input:checked)) .fancy-checkbox__icon { +.fancy-checkbox :not(input:checked) + .fancy-checkbox__icon { path { transition-delay: 0.05s; } } -.fancy-checkbox:has(input:checked) .fancy-checkbox__icon { +.fancy-checkbox input:checked + .fancy-checkbox__icon { path { stroke-dashoffset: 60; }