Skip to content

Commit

Permalink
Add onAdditionalControlsToggle
Browse files Browse the repository at this point in the history
  • Loading branch information
nomcopter committed Jul 29, 2022
1 parent 8196cd6 commit 9c698ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MosaicWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface MosaicWindowProps<T extends MosaicKey> {
toolbarControls?: React.ReactNode;
additionalControls?: React.ReactNode;
additionalControlButtonText?: string;
onAdditionalControlsToggle?: (toggle: boolean) => void;
draggable?: boolean;
createNode?: CreateNode<T>;
renderPreview?: (props: MosaicWindowProps<T>) => JSX.Element;
Expand Down Expand Up @@ -222,6 +223,7 @@ export class InternalMosaicWindow<T extends MosaicKey> extends React.Component<

private setAdditionalControlsOpen = (additionalControlsOpen: boolean) => {
this.setState({ additionalControlsOpen });
this.props.onAdditionalControlsToggle?.(additionalControlsOpen);
};

private getPath = () => this.props.path;
Expand Down

0 comments on commit 9c698ef

Please sign in to comment.