Skip to content

Commit 526618b

Browse files
committed
fix(ui): prevent event propagation in DeleteTutorialButton click handler
- Prevent event propagation when the delete button is clicked, because it causes the section element behind it to expand/collapse
1 parent c0c7f2c commit 526618b

File tree

1 file changed

+4
-1
lines changed
  • redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/DeleteTutorialButton

1 file changed

+4
-1
lines changed

redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/DeleteTutorialButton/DeleteTutorialButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ const DeleteTutorialButton = (props: Props) => {
2222
const { id, label, onDelete, isLoading } = props
2323
const [isPopoverDeleteOpen, setIsPopoverDeleteOpen] = useState<boolean>(false)
2424

25-
const handleClickDelete = () => {
25+
const handleClickDelete = (
26+
e: React.MouseEvent<HTMLButtonElement, MouseEvent>,
27+
) => {
28+
e.stopPropagation()
2629
setIsPopoverDeleteOpen((v) => !v)
2730
}
2831

0 commit comments

Comments
 (0)