Skip to content

Commit

Permalink
fix: issue with drawer closing on every key
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Apr 30, 2024
1 parent 0029278 commit 9930785
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/drawer/drawer.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function DBDrawer(props: DBDrawerProps) {
props.backdrop !== 'none')
) {
if (props.onClose) {
props.onClose();
props.onClose(event);
}
}
},
Expand Down
18 changes: 9 additions & 9 deletions packages/components/src/components/drawer/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@ import {
} from '../../shared/model';

export interface DBDrawerDefaultProps {
/**
* The backdrop attribute changes the opacity of the backdrop.
* The backdrop 'none' will use `dialog.show()` instead of `dialog.showModal()`
*/
backdrop?: 'strong' | 'weak' | 'invisible' | 'none';

/**
* The direction attribute changes the position & animation of the drawer.
* E. g. "left" slides from left screen border to the right.
* E.g. "left" slides from left screen border to the right.
*/
direction?: 'left' | 'right' | 'up' | 'down';

/**
* The backdrop attribute changes the opacity of the backdrop.
* The backdrop 'none' will use `dialog.show()` instead of `dialog.showModal()`
* React specific to change the header of the drawer.
*/
backdrop?: 'strong' | 'weak' | 'invisible' | 'none';

drawerHeader?: unknown;
/**
* The open attribute opens or closes the drawer based on the state.
*/
Expand All @@ -29,10 +33,6 @@ export interface DBDrawerDefaultProps {
* The "end" depends on which direction you use.
*/
rounded?: boolean;
/**
* React specific to change the header of the drawer.
*/
drawerHeader?: unknown;
/**
* The @dependabot recreate attribute changes the padding inside the drawer.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/shared/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export type CloseEventProps = {
/**
* Function to handle button click (close).
*/
onClose?: () => void;
onClose?: (event?: any) => void;
};

export type CloseEventState = {
Expand Down

0 comments on commit 9930785

Please sign in to comment.