From 93c616de23f673ec3503dce97d3e2cade489fe8e Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 4 Sep 2022 22:04:48 -0400 Subject: [PATCH] Prevent some event bubbling issues --- src/components/SelectorComponent.tsx | 5 ++++- src/components/SponsorTimeEditComponent.tsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/SelectorComponent.tsx b/src/components/SelectorComponent.tsx index 018d78a6..a47054fc 100644 --- a/src/components/SelectorComponent.tsx +++ b/src/components/SelectorComponent.tsx @@ -41,7 +41,10 @@ class SelectorComponent extends React.Component { for (const option of this.props.options) { result.push(
this.props.onChange(option.label)} + onClick={(e) => { + e.stopPropagation(); + this.props.onChange(option.label); + }} key={option.label}> {option.label}
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 3ba8921b..61ee83b9 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -237,6 +237,7 @@ class SponsorTimeEditComponent extends React.Component e.stopPropagation()} onChange={(e) => this.descriptionUpdate(e.target.value)} onFocus={() => this.setState({chapterNameSelectorOpen: true})}>