Skip to content

Commit 81e808e

Browse files
committed
Merge branch 'filePickerUploadFix' of https://github.com/gautamdsheth/sp-dev-fx-controls-react into gautamdsheth-filePickerUploadFix
2 parents 6aa7577 + 07a7431 commit 81e808e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/controls/filePicker/UploadFilePickerTab/UploadFilePickerTab.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ export default class UploadFilePickerTab extends React.Component<IUploadFilePick
3535
accept={acceptedFilesExtensions} multiple={false} onChange={(event: React.ChangeEvent<HTMLInputElement>) => this._handleFileUpload(event)}
3636
/>
3737
{
38-
fileName &&
38+
fileName && this.state.filePreview &&
3939
/** Display image preview */
40-
<div className={styles.localTabSinglePreview}>
41-
{
42-
this.state.filePreview &&
43-
<img className={styles.localTabSinglePreviewImage} src={this.state.filePreview} alt={this.state.filePickerResult.fileName} />
44-
}
40+
<div className={styles.localTabSinglePreview}>
41+
<img className={styles.localTabSinglePreviewImage} src={this.state.filePreview} alt={this.state.filePickerResult.fileName} />
4542
</div>
4643
}
44+
<div>
45+
<label className={styles.localTabLabel}>{
46+
(!this.state.filePreview ? fileName : "")
47+
}</label>
48+
</div>
4749
<label className={styles.localTabLabel} htmlFor="fileInput">{
4850
(fileName ? strings.ChangeFileLinkLabel : strings.ChooseFileLinkLabel)
4951
}</label>

0 commit comments

Comments
 (0)