TagsInput: Fix layout issue with tags input (#33907)

This commit is contained in:
Torkel Ödegaard 2021-05-11 11:43:36 +02:00 committed by GitHub
parent e98a8bd11b
commit d2a1b8fd95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,27 +47,28 @@ export const TagsInput: FC<Props> = ({ placeholder = 'New tag (enter key to add)
return <TagItem key={`${tag}-${index}`} name={tag} onRemove={onRemove} />;
})}
</div>
<Input
placeholder={placeholder}
onChange={onNameChange}
value={newTagName}
onKeyUp={onKeyboardAdd}
suffix={
newTagName.length > 0 && (
<Button fill="text" className={styles.addButtonStyle} onClick={onAdd} size="md">
Add
</Button>
)
}
/>
<div>
<Input
placeholder={placeholder}
onChange={onNameChange}
value={newTagName}
onKeyUp={onKeyboardAdd}
suffix={
newTagName.length > 0 && (
<Button fill="text" className={styles.addButtonStyle} onClick={onAdd} size="md">
Add
</Button>
)
}
/>
</div>
</div>
);
};
const getStyles = (theme: GrafanaTheme) => ({
wrapper: css`
height: ${theme.spacing.formInputHeight}px;
min-height: ${theme.spacing.formInputHeight}px;
align-items: center;
display: flex;
flex-wrap: wrap;