File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,20 @@ export class FilePicker extends React.Component<
115
115
} ) ;
116
116
}
117
117
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
+
118
132
public render ( ) : JSX . Element {
119
133
// If no acceptable file type was passed, and we're expecting images, set the default image filter
120
134
const accepts : string [ ] = this . props . accepts ;
@@ -451,6 +465,6 @@ export class FilePicker extends React.Component<
451
465
if ( ! props . hideLocalMultipleUploadTab ) {
452
466
return "keyMultipleUpload" ;
453
467
}
454
-
468
+
455
469
}
456
470
}
You can’t perform that action at this time.
0 commit comments