Prevent some event bubbling issues

This commit is contained in:
Ajay 2022-09-04 22:04:48 -04:00
parent ee25b41d7e
commit 93c616de23
2 changed files with 5 additions and 1 deletions

View file

@ -41,7 +41,10 @@ class SelectorComponent extends React.Component<SelectorProps, SelectorState> {
for (const option of this.props.options) {
result.push(
<div className="sbSelectorOption"
onClick={() => this.props.onChange(option.label)}
onClick={(e) => {
e.stopPropagation();
this.props.onChange(option.label);
}}
key={option.label}>
{option.label}
</div>

View file

@ -237,6 +237,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
ref={this.descriptionOptionRef}
type="text"
value={this.state.description}
onContextMenu={(e) => e.stopPropagation()}
onChange={(e) => this.descriptionUpdate(e.target.value)}
onFocus={() => this.setState({chapterNameSelectorOpen: true})}>
</input>