Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix color chooser menu state in Group Comparison dropdown of study view #4289

Merged
merged 1 commit into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions src/pages/groupComparison/comparisonGroupManager/GroupCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ export default class GroupCheckbox extends React.Component<
this.props.shareGroup(this.props.group);
}

@autobind
private onOverlayEnter() {
this.props.store.numberOfVisibleColorChooserModals += 1;
}

@autobind
private onOverlayExit() {
this.props.store.numberOfVisibleColorChooserModals -= 1;
}

@computed get label() {
return (
<span
Expand Down Expand Up @@ -136,14 +126,15 @@ export default class GroupCheckbox extends React.Component<
};

buildColorChooserWidget = () => (
<Popover
id="popover-basic"
onClick={e => {
e.stopPropagation();
e.preventDefault();
}}
>
<div>
<Popover>
<div
onMouseDown={e => {
e.nativeEvent.stopImmediatePropagation();
}}
onClick={e => {
e.nativeEvent.stopImmediatePropagation();
}}
>
<CirclePicker
colors={this.colorList}
circleSize={20}
Expand Down Expand Up @@ -229,19 +220,12 @@ export default class GroupCheckbox extends React.Component<
trigger="click"
placement="bottom"
overlay={this.buildColorChooserWidget()}
onEnter={this.onOverlayEnter}
onExit={this.onOverlayExit}
rootClose={true}
>
<DefaultTooltip
overlay={
'Optional: Select color for group to be used in group comparison. If no color is selected, a random color will be applied.'
}
disabled={
this.props.store
.numberOfVisibleColorChooserModals >
0
}
>
<span
style={{
Expand Down
9 changes: 0 additions & 9 deletions src/pages/studyView/StudyViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export default class StudyViewPage extends React.Component<
{/* </InfoBeacon>*/}
{/*</If>*/}
<DefaultTooltip
visible={this.store.showComparisonGroupUI}
trigger={['click']}
placement="bottomLeft"
destroyTooltipOnHide={true}
Expand All @@ -412,14 +411,6 @@ export default class StudyViewPage extends React.Component<
);
arrowEl.style.right = '10px';
}}
onVisibleChange={visible => {
if (
this.store.numberOfVisibleColorChooserModals == 0 &&
!this.shareLinkModal
) {
this.store.showComparisonGroupUI = !!visible;
}
}}
getTooltipContainer={() =>
document.getElementById(
'comparisonGroupManagerContainer'
Expand Down