-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Embed block: Enable replace option #33253
Conversation
@@ -238,6 +238,7 @@ const EmbedEdit = ( props ) => { | |||
invalidateResolution( 'getEmbedPreview', [ url ] ); | |||
} } | |||
isSelected={ isSelected } | |||
isEditingURL={ isEditingURL } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEditingURL
is true
when the replace action is triggered.
@@ -39,7 +40,7 @@ const EmbedPlaceholder = ( { | |||
[ clientId ] | |||
); | |||
const [ isEmbedSheetVisible, setIsEmbedSheetVisible ] = useState( | |||
isSelected && wasBlockJustInserted && ! value | |||
isSelected && ( ( wasBlockJustInserted && ! value ) || isEditingURL ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change enables the bottom sheet to be automatically displayed when the replace action is triggered.
Size Change: +9 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I understood what you commented, do you mean that we should display the invalid error message for the value I'd like to note that |
I think
I think this was working before, because maybe we were using |
I think there are two different validations on this block:
Not sure, from the code, looks like the prepend happens before calling the gutenberg/packages/components/src/mobile/link-settings/index.native.js Lines 140 to 144 in 1eaad3c
gutenberg/packages/components/src/mobile/link-settings/index.native.js Lines 162 to 173 in 1eaad3c
|
Ah, I guess then |
No worries, I was also surprised when I saw that weird URLs like |
* Add replace option to native version of embed block * Add invalid and empty URL cases to replace action
gutenberg-mobile
PR: wordpress-mobile/gutenberg-mobile#3703Description
Implement and enable the replace option as described in this issue.
How has this been tested?
Replace URL
Invalid URL
http://
)Empty URL
Screenshots
embed-block-replace-option.mp4
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).