From ca7217e32d6c267744d1bb9f3a58f35ddbc9f33e Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Thu, 24 Sep 2020 16:20:44 +0200 Subject: [PATCH 1/5] Mobile - Fix Buttons block text input --- packages/block-editor/src/components/rich-text/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 0b36ed4e9754bb..452f5c4ca0549b 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -144,6 +144,8 @@ function RichTextWrapper( fontFamily, fontWeight, fontStyle, + minWidth, + maxWidth, ...props }, forwardedRef @@ -603,6 +605,8 @@ function RichTextWrapper( fontFamily={ fontFamily } fontWeight={ fontWeight } fontStyle={ fontStyle } + minWidth={ minWidth } + maxWidth={ maxWidth } > { ( { isSelected: nestedIsSelected, From 6556acec3bcd4fcb3193371025ab374179e52676 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Thu, 24 Sep 2020 17:34:08 +0200 Subject: [PATCH 2/5] Mobile - RichText - Add missing props for native --- packages/block-editor/src/components/rich-text/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 452f5c4ca0549b..7780ddd4d71243 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -146,6 +146,9 @@ function RichTextWrapper( fontStyle, minWidth, maxWidth, + onBlur, + setRef, + id, ...props }, forwardedRef @@ -607,6 +610,9 @@ function RichTextWrapper( fontStyle={ fontStyle } minWidth={ minWidth } maxWidth={ maxWidth } + onBlur={ onBlur } + setRef={ setRef } + id={ id } > { ( { isSelected: nestedIsSelected, From 8e8e452cc74af59365e49d26e98ea257cb654a2d Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 25 Sep 2020 09:37:59 +0200 Subject: [PATCH 3/5] Mobile - RichText - Pass id prop to native component --- packages/block-editor/src/components/rich-text/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 7780ddd4d71243..0927e353b0d818 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -148,7 +148,6 @@ function RichTextWrapper( maxWidth, onBlur, setRef, - id, ...props }, forwardedRef @@ -612,7 +611,7 @@ function RichTextWrapper( maxWidth={ maxWidth } onBlur={ onBlur } setRef={ setRef } - id={ id } + id={ props.id } > { ( { isSelected: nestedIsSelected, From 09f46b0802bba1a4c487f951008846832f557871 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 25 Sep 2020 15:36:33 +0200 Subject: [PATCH 4/5] Mobile - RichText - Add comment for mobile prop --- packages/block-editor/src/components/rich-text/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 0927e353b0d818..867e4ab1fa32e7 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -611,7 +611,7 @@ function RichTextWrapper( maxWidth={ maxWidth } onBlur={ onBlur } setRef={ setRef } - id={ props.id } + id={ props.id } // Destructuring the id prop breaks the editor > { ( { isSelected: nestedIsSelected, From a0def960099e810559faf0dd83b4c96d15e230a7 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 25 Sep 2020 15:39:52 +0200 Subject: [PATCH 5/5] Mobile - RichText - update comment --- packages/block-editor/src/components/rich-text/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 867e4ab1fa32e7..2e007b629da62c 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -611,7 +611,9 @@ function RichTextWrapper( maxWidth={ maxWidth } onBlur={ onBlur } setRef={ setRef } - id={ props.id } // Destructuring the id prop breaks the editor + // Destructuring the id prop before { ...props } doesn't work + // correctly on web https://github.com/WordPress/gutenberg/pull/25624 + id={ props.id } > { ( { isSelected: nestedIsSelected,