Skip to content

Commit

Permalink
Fix: File block add custom class (#13432)
Browse files Browse the repository at this point in the history
## Description
The custom class should only be added to the wrapper, not every div
Fixes #13430
  • Loading branch information
Soean authored and youknowriad committed Mar 6, 2019
1 parent 54672c9 commit 53067fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ class FileEdit extends Component {
</MediaUploadCheck>
</BlockControls>
<div className={ classes }>
<div className={ `${ className }__content-wrapper` }>
<div className={ 'wp-block-file__content-wrapper' }>
<RichText
wrapperClassName={ `${ className }__textlink` }
wrapperClassName={ 'wp-block-file__textlink' }
tagName="div" // must be block-level or else cursor disappears
value={ fileName }
placeholder={ __( 'Write file name…' ) }
Expand All @@ -195,11 +195,11 @@ class FileEdit extends Component {
onChange={ ( text ) => setAttributes( { fileName: text } ) }
/>
{ showDownloadButton &&
<div className={ `${ className }__button-richtext-wrapper` }>
<div className={ 'wp-block-file__button-richtext-wrapper' }>
{ /* Using RichText here instead of PlainText so that it can be styled like a button */ }
<RichText
tagName="div" // must be block-level or else cursor disappears
className={ `${ className }__button` }
className={ 'wp-block-file__button' }
value={ downloadButtonText }
formattingControls={ [] } // disable controls
placeholder={ __( 'Add text…' ) }
Expand All @@ -213,7 +213,7 @@ class FileEdit extends Component {
<ClipboardButton
isDefault
text={ href }
className={ `${ className }__copy-url-button` }
className={ 'wp-block-file__copy-url-button' }
onCopy={ this.confirmCopyURL }
onFinishCopy={ this.resetCopyConfirmation }
disabled={ isBlobURL( href ) }
Expand Down

0 comments on commit 53067fd

Please sign in to comment.