Skip to content

Commit

Permalink
fix: OPTIC-885: Links not clickable from within Radio Button (#6097) (#…
Browse files Browse the repository at this point in the history
…6102)

* fix: OPTIC-885: Links not clickable from within Radio Button

* add a comment stating this fix needs to be revisited
  • Loading branch information
bmartel authored Jul 16, 2024
1 parent 0529ff8 commit d8a37cb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d8a37cb

Please sign in to comment.