Skip to content

Commit

Permalink
File block: Make the editor markup match the frontend (#30148)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Mar 23, 2021
1 parent 126baf0 commit e901d0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
22 changes: 11 additions & 11 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ function FileEdit( { attributes, setAttributes, noticeUI, noticeOperations } ) {
</BlockControls>
<div { ...blockProps }>
<div className={ 'wp-block-file__content-wrapper' }>
<div className="wp-block-file__textlink">
<RichText
tagName="div" // must be block-level or else cursor disappears
value={ fileName }
placeholder={ __( 'Write file name…' ) }
withoutInteractiveFormatting
onChange={ ( text ) =>
setAttributes( { fileName: text } )
}
/>
</div>
<RichText
style={ { display: 'inline-block' } }
tagName="a" // must be block-level or else cursor disappears
value={ fileName }
placeholder={ __( 'Write file name…' ) }
withoutInteractiveFormatting
onChange={ ( text ) =>
setAttributes( { fileName: text } )
}
href={ textLinkHref }
/>
{ showDownloadButton && (
<div
className={
Expand Down
7 changes: 1 addition & 6 deletions packages/block-library/src/file/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
flex-grow: 1;
}

.wp-block-file__textlink {
display: inline-block;
a {
min-width: 1em;

&:focus {
box-shadow: none;
}
}

.wp-block-file__button-richtext-wrapper {
Expand Down

0 comments on commit e901d0a

Please sign in to comment.