Skip to content

Commit 6f10e24

Browse files
F-X64major
authored andcommitted
Close drawer if table changes
Add close on page change Add close on search
1 parent a691211 commit 6f10e24

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/app/components/ImageTable.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@ import {
77
ToolbarItem,
88
Pagination,
99
Drawer,
10-
DrawerPanelContent,
1110
DrawerContent,
1211
DrawerContentBody,
13-
DrawerHead,
14-
DrawerActions,
15-
DrawerCloseButton,
1612
Button
1713
} from '@patternfly/react-core';
1814
import { Table, Thead, Tr, Th, ThProps, Tbody, Td } from '@patternfly/react-table';
1915
import { fetch } from 'cross-fetch'
2016
import { DetailsDrawer } from './DetailsDrawer';
21-
import { MouseEventHandler } from 'react';
2217
interface ImageData {
2318
name: string;
2419
version: string;
@@ -46,7 +41,7 @@ export const ImageTable: React.FunctionComponent = () => {
4641
drawerRef.current && drawerRef.current.focus();
4742
};
4843

49-
const onDrawerOpenClick = (details) => {
44+
const onDrawerOpenClick = (details: object) => {
5045
setIsExpanded(true);
5146
setSelectedImage(details)
5247
};
@@ -78,6 +73,7 @@ export const ImageTable: React.FunctionComponent = () => {
7873
}
7974

8075
const handleSearch = (event) => {
76+
setIsExpanded(false);
8177
setSearch(event.target.value);
8278
setPage(1);
8379
};
@@ -100,6 +96,7 @@ export const ImageTable: React.FunctionComponent = () => {
10096
};
10197

10298
const onSetPage = (_event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number) => {
99+
setIsExpanded(false);
103100
setPage(newPage);
104101
};
105102

0 commit comments

Comments
 (0)