diff --git a/client/src/components/categorical/category.js b/client/src/components/categorical/category.js index f79dc526..7d53cff7 100644 --- a/client/src/components/categorical/category.js +++ b/client/src/components/categorical/category.js @@ -237,45 +237,6 @@ class Category extends React.Component { {""} - {/* Dialog uses portal, can be anywhere/factored out */} - -
-
-

New, unique category name:

- - this.setState({ newCategoryText: e.target.value }) - } - leftIcon="tag" - /> -
-
-
-
- - - - -
-
-
{ - this.setState({ isExpanded: !isExpanded }); + const editingCategory = + annotations.isEditingCategoryName && + annotations.categoryBeingEdited === metadataField; + if (!editingCategory) { + this.setState({ isExpanded: !isExpanded }); + } }} > {isUserAnno ? ( ) : null} - {metadataField} + + {annotations.isEditingCategoryName && + annotations.categoryBeingEdited === metadataField ? ( +
{ + e.preventDefault(); + this.handleEditCategory(); + }} + > + { + this.editableCategoryInput = input; + }} + small + autoFocus + onChange={e => { + this.setState({ + newCategoryText: e.target.value + }); + }} + defaultValue={metadataField} + rightElement={ +