Skip to content

Commit

Permalink
Remove this worthless callback that has a bug
Browse files Browse the repository at this point in the history
I can find no evidence of people using it, and it has the same defect as #3055
  • Loading branch information
pwolfert committed Apr 25, 2024
1 parent 6f37119 commit f973d46
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
9 changes: 0 additions & 9 deletions packages/design-system/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ export interface BaseDialogProps extends AnalyticsOverrideProps {
* Controls whether the dialog is in an open state
*/
isOpen?: boolean;
/**
* This function is called after the modal opens
*/
onEnter?(): void;
/**
* Called when the user triggers an exit event, like by clicking the close
* button or pressing the ESC key. The parent of this component is
Expand Down Expand Up @@ -96,7 +92,6 @@ export const Dialog = (props: DialogProps) => {
headerClassName,
heading,
id,
onEnter,
onExit,
size,
...modalProps
Expand All @@ -113,10 +108,6 @@ export const Dialog = (props: DialogProps) => {

const containerRef = useRef<HTMLDivElement>();

useEffect(() => {
if (onEnter) onEnter();
}, []);

// Set initial focus
useEffect(() => {
containerRef.current?.focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@
"Optional callback that will intercept analytics events for this component. If none is specified, the design system will use the default analytics function, which can be overwritten globally with the defaultAnalyticsFunction config property.\n\n(event: AnalyticsEvent) => void",
"-"
],
[
"onEnter",
"This function is called after the modal opens\n() => void",
"-"
],
[
"onExit*",
"Called when the user triggers an exit event, like by clicking the close button or pressing the ESC key. The parent of this component is responsible for showing or not showing the dialog, so you need to use this callback to make that happen. The dialog does not hide or remove itself.\n\n(event: MouseEvent<Element, MouseEvent> | KeyboardEvent<Element>) => void",
Expand Down

0 comments on commit f973d46

Please sign in to comment.