Skip to content

A platform for community discussion. Free, open, simple.

FIX: ensures whole label has cursor disabled (#37474)

Joffrey JAFFEUX34377e20c042
diff --git a/app/assets/stylesheets/common/form-kit/_conditional-display.scss b/app/assets/stylesheets/common/form-kit/_conditional-display.scss
index e7139ab3721..f8db6cd62f1 100644
--- a/app/assets/stylesheets/common/form-kit/_conditional-display.scss
+++ b/app/assets/stylesheets/common/form-kit/_conditional-display.scss
@@ -5,11 +5,6 @@
flex-direction: column;
gap: var(--space-3);
- input[disabled] + span {
- color: var(--primary-medium);
- cursor: not-allowed;
- }
-
&-content {
display: flex;
flex-direction: column;
@@ -33,9 +28,9 @@
gap: var(--space-2);
width: 100%;
- label:hover {
+ .form-kit__control-radio-label:not(.--disabled):hover {
cursor: pointer;
- border: 1px solid var(--tertiary);
+ border-color: var(--tertiary);
}
> * {
@@ -56,6 +51,11 @@
position: relative;
line-height: normal;
+ &.--disabled {
+ color: var(--primary-medium);
+ cursor: not-allowed;
+ }
+
.d-icon {
display: none;
}
diff --git a/frontend/discourse/app/form-kit/components/fk/control/conditional-content/condition.gjs b/frontend/discourse/app/form-kit/components/fk/control/conditional-content/condition.gjs
index 1a16db6b6ce..c579e384cf9 100644
--- a/frontend/discourse/app/form-kit/components/fk/control/conditional-content/condition.gjs
+++ b/frontend/discourse/app/form-kit/components/fk/control/conditional-content/condition.gjs
@@ -1,12 +1,19 @@
import { fn } from "@ember/helper";
import { on } from "@ember/modifier";
import FKLabel from "discourse/form-kit/components/fk/label";
+import concatClass from "discourse/helpers/concat-class";
import uniqueId from "discourse/helpers/unique-id";
import { eq } from "discourse/truth-helpers";
const FKControlConditionalContentOption = <template>
{{#let (uniqueId) as |uuid|}}
- <FKLabel @fieldId={{uuid}} class="form-kit__control-radio-label">
+ <FKLabel
+ @fieldId={{uuid}}
+ class={{concatClass
+ "form-kit__control-radio-label"
+ (if @disabled "--disabled")
+ }}
+ >
<input
type="radio"
id={{uuid}}