mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-10 05:10:57 +08:00
use AnchorButton so the tooltip dismisses (#1217)
This commit is contained in:
@@ -2,7 +2,7 @@ import React from "react";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { FaChevronRight, FaChevronDown } from "react-icons/fa";
|
import { FaChevronRight, FaChevronDown } from "react-icons/fa";
|
||||||
import { Button, Tooltip, Icon } from "@blueprintjs/core";
|
import { AnchorButton, Button, Tooltip, Icon } from "@blueprintjs/core";
|
||||||
import CategoryFlipperLayout from "./categoryFlipperLayout";
|
import CategoryFlipperLayout from "./categoryFlipperLayout";
|
||||||
import AnnoMenu from "./annoMenuCategory";
|
import AnnoMenu from "./annoMenuCategory";
|
||||||
import AnnoDialogEditCategoryName from "./annoDialogEditCategoryName";
|
import AnnoDialogEditCategoryName from "./annoDialogEditCategoryName";
|
||||||
@@ -158,7 +158,11 @@ class Category extends React.Component {
|
|||||||
return this.renderIsStillLoading();
|
return this.renderIsStillLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
const isTruncated = _.get(categoricalSelection, [metadataField, "isTruncated"], false);
|
const isTruncated = _.get(
|
||||||
|
categoricalSelection,
|
||||||
|
[metadataField, "isTruncated"],
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CategoryFlipperLayout
|
<CategoryFlipperLayout
|
||||||
@@ -198,14 +202,17 @@ class Category extends React.Component {
|
|||||||
annotations.isEditingCategoryName &&
|
annotations.isEditingCategoryName &&
|
||||||
annotations.categoryBeingEdited === metadataField;
|
annotations.categoryBeingEdited === metadataField;
|
||||||
if (!editingCategory) {
|
if (!editingCategory) {
|
||||||
onExpansionChange(metadataField)
|
onExpansionChange(metadataField);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isUserAnno ? (
|
{isUserAnno ? (
|
||||||
<Icon style={{ marginRight: 5 }} icon="tag" iconSize={16} />
|
<Icon style={{ marginRight: 5 }} icon="tag" iconSize={16} />
|
||||||
) : null}
|
) : null}
|
||||||
{maybeTruncateString(metadataField, globals.categoryDisplayStringMaxLength)}
|
{maybeTruncateString(
|
||||||
|
metadataField,
|
||||||
|
globals.categoryDisplayStringMaxLength
|
||||||
|
)}
|
||||||
{isExpanded ? (
|
{isExpanded ? (
|
||||||
<FaChevronDown
|
<FaChevronDown
|
||||||
data-testclass="category-expand-is-expanded"
|
data-testclass="category-expand-is-expanded"
|
||||||
@@ -240,7 +247,7 @@ class Category extends React.Component {
|
|||||||
usePortal={false}
|
usePortal={false}
|
||||||
hoverOpenDelay={globals.tooltipHoverOpenDelay}
|
hoverOpenDelay={globals.tooltipHoverOpenDelay}
|
||||||
>
|
>
|
||||||
<Button
|
<AnchorButton
|
||||||
data-testclass="colorby"
|
data-testclass="colorby"
|
||||||
data-testid={`colorby-${metadataField}`}
|
data-testid={`colorby-${metadataField}`}
|
||||||
onClick={this.handleColorChange}
|
onClick={this.handleColorChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user