From d204c47174e7480c2283953d894e7632c76dd0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni=20Erkkil=C3=A4?= Date: Fri, 12 May 2023 23:37:26 +0300 Subject: [PATCH 1/3] Added wrapper element for RichText this will make editor able find focus on RichText even if there is no value --- packages/block-library/src/file/edit.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/block-library/src/file/edit.js b/packages/block-library/src/file/edit.js index 733cdf9a9351fc..80d33c6d009674 100644 --- a/packages/block-library/src/file/edit.js +++ b/packages/block-library/src/file/edit.js @@ -271,16 +271,18 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) { ) }
- - setAttributes( { fileName: text } ) - } - href={ textLinkHref } - /> +
+ + setAttributes( { fileName: text } ) + } + href={ textLinkHref } + /> +
{ showDownloadButton && (
Date: Fri, 19 May 2023 13:50:11 +0300 Subject: [PATCH 2/3] Removed wrapper div from RichText element --- packages/block-library/src/file/edit.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/block-library/src/file/edit.js b/packages/block-library/src/file/edit.js index 80d33c6d009674..733cdf9a9351fc 100644 --- a/packages/block-library/src/file/edit.js +++ b/packages/block-library/src/file/edit.js @@ -271,18 +271,16 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) { ) }
-
- - setAttributes( { fileName: text } ) - } - href={ textLinkHref } - /> -
+ + setAttributes( { fileName: text } ) + } + href={ textLinkHref } + /> { showDownloadButton && (
Date: Fri, 19 May 2023 13:51:05 +0300 Subject: [PATCH 3/3] Added display: inline-block declaration for non-button links inside file block --- packages/block-library/src/file/editor.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-library/src/file/editor.scss b/packages/block-library/src/file/editor.scss index f9d1f544ada07c..365ba5ec1dc222 100644 --- a/packages/block-library/src/file/editor.scss +++ b/packages/block-library/src/file/editor.scss @@ -35,6 +35,10 @@ a { min-width: 1em; + + &:not(.wp-block-file__button) { + display: inline-block; + } } .wp-block-file__button-richtext-wrapper {