Skip to content

Commit 8865603

Browse files
Allow panel on FilePicker to be open after first load
1 parent c0117c9 commit 8865603

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/controls/filePicker/FilePicker.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ export class FilePicker extends React.Component<
115115
});
116116
}
117117

118+
/**
119+
* componentWillReceiveProps lifecycle hook
120+
*
121+
* @param nextProps
122+
*/
123+
public componentWillReceiveProps(nextProps: IFilePickerProps): void {
124+
if (nextProps.isPanelOpen || nextProps.isPanelOpen !== this.props.isPanelOpen) {
125+
this.setState({
126+
panelOpen: nextProps.isPanelOpen
127+
});
128+
129+
}
130+
}
131+
118132
public render(): JSX.Element {
119133
// If no acceptable file type was passed, and we're expecting images, set the default image filter
120134
const accepts: string[] = this.props.accepts;
@@ -451,6 +465,6 @@ export class FilePicker extends React.Component<
451465
if (!props.hideLocalMultipleUploadTab) {
452466
return "keyMultipleUpload";
453467
}
454-
468+
455469
}
456470
}

0 commit comments

Comments
 (0)