feat: When editing the label/title in the Metrics popover, hitting Enter should save what you've typed (#19898)

* feature: When editing the label/title in the Metrics popover, hitting Enter should save what you've typed

* Apply emotion templating to input/input labels
This commit is contained in:
Diego Medina
2022-06-08 18:52:53 -04:00
committed by GitHub
parent eab0009101
commit 5bfc95e79e
6 changed files with 276 additions and 194 deletions

View File

@@ -17,10 +17,16 @@
* under the License.
*/
import React, { useCallback, useState } from 'react';
import { t } from '@superset-ui/core';
import { t, styled } from '@superset-ui/core';
import { Input } from 'src/components/Input';
import { Tooltip } from 'src/components/Tooltip';
const StyledInput = styled(Input)`
border-radius: ${({ theme }) => theme.borderRadius};
height: 26px;
padding-left: ${({ theme }) => theme.gridUnit * 2.5}px;
`;
export const DndColumnSelectPopoverTitle = ({
title,
onChange,
@@ -63,8 +69,7 @@ export const DndColumnSelectPopoverTitle = ({
}
return isEditMode ? (
<Input
className="metric-edit-popover-label-input"
<StyledInput
type="text"
placeholder={title}
value={hasCustomLabel ? title : ''}