From d8a37cbf7e9896364e2d32faa2cf51f715f83371 Mon Sep 17 00:00:00 2001 From: bmartel Date: Tue, 16 Jul 2024 08:15:17 -0500 Subject: [PATCH] fix: OPTIC-885: Links not clickable from within Radio Button (#6097) (#6102) * fix: OPTIC-885: Links not clickable from within Radio Button * add a comment stating this fix needs to be revisited --- .../src/components/Form/Elements/RadioGroup/RadioGroup.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/apps/labelstudio/src/components/Form/Elements/RadioGroup/RadioGroup.jsx b/web/apps/labelstudio/src/components/Form/Elements/RadioGroup/RadioGroup.jsx index 7c9d6201a6b5..ead0b53dde4b 100644 --- a/web/apps/labelstudio/src/components/Form/Elements/RadioGroup/RadioGroup.jsx +++ b/web/apps/labelstudio/src/components/Form/Elements/RadioGroup/RadioGroup.jsx @@ -74,6 +74,9 @@ const RadioButton = ({ value, disabled, children, label, description, ...props } const clickHandler = useCallback( (e) => { + // TODO: Find a better way to prevent the click event from being triggered by the child element + // that works beyond just the anchor tag. Otherwise there will be problems with other components/elements. + if (e.target.tagName === "A") return; e.preventDefault(); e.stopPropagation(); if (disabled) return;