Fix dropdown jump effect bug on mouse over in topics list (#1875)

* fix dropdown jump effect bug on mouse over in topics list

* fix isHidden condition
This commit is contained in:
Arsen Simonyan 2022-04-22 13:01:08 +04:00 committed by GitHub
parent 4c76d07f04
commit 62f4778803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -24,4 +24,5 @@ export const Link = styled(NavLink).attrs({ activeClassName: 'is-active' })<{
export const ActionsTd = styled(Td)`
overflow: visible;
width: 50px;
`;

View file

@ -185,6 +185,8 @@ const List: React.FC<TopicsListProps> = ({
setRecreateTopicConfirmationVisible,
] = React.useState(false);
const isHidden = internal || isReadOnly || !hovered;
const deleteTopicHandler = React.useCallback(() => {
deleteTopic(clusterName, name);
}, [name]);
@ -200,8 +202,8 @@ const List: React.FC<TopicsListProps> = ({
return (
<>
{!internal && !isReadOnly && hovered ? (
<div className="has-text-right">
<div className="has-text-right">
{!isHidden && (
<Dropdown label={<VerticalElipsisIcon />} right>
{cleanUpPolicy === CleanUpPolicy.DELETE && (
<DropdownItem onClick={clearTopicMessagesHandler} danger>
@ -223,8 +225,8 @@ const List: React.FC<TopicsListProps> = ({
Recreate Topic
</DropdownItem>
</Dropdown>
</div>
) : null}
)}
</div>
<ConfirmationModal
isOpen={isDeleteTopicConfirmationVisible}
onCancel={() => setDeleteTopicConfirmationVisible(false)}