Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: File block add custom class #13432

Merged
merged 2 commits into from
Jan 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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