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

Hide tooltip when hovering over the attribution group and between top level groups. #413

Merged
merged 2 commits into from Jan 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions client/components/Treemap.jsx
Expand Up @@ -105,9 +105,12 @@ export default class Treemap extends Component {
},
onGroupDoubleClick: preventDefault,
onGroupHover(event) {
// Ignoring hovering on `FoamTree` branding group
if (event.group && event.group.attribution) {
// Ignoring hovering on `FoamTree` branding group and the root group
if (event.group && (event.group.attribution || event.group === this.get('dataObject'))) {
event.preventDefault();
if (props.onMouseLeave) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this conditional? Is there a place in the code where props.onMouseLeave would not be specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the condition analogous to the props.onGroupHover check below, which is also there but probably not required:

        if (props.onGroupHover) {
          props.onGroupHover.call(component, event);
        }

I can remove the props.onMouseLeave condition, not a problem.

props.onMouseLeave.call(component, event);
}
return;
}

Expand Down