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

Display embeds error message only when the form is submitted #10591

Closed
wants to merge 1 commit into from

Conversation

imath
Copy link
Contributor

@imath imath commented Oct 14, 2018

Testing Gutenberg 4.0.0-RC1 I noticed a confusing behavior about the Embeds blocks. As soon as you enter some content into the URL input there is an error message that is added under the URL input no matter if the URL is actually embeddable. I would suggest to wait untill the form has been submitted to eventually display this error. Otherwise some users like me might be confused to see this error although the URL is embeddable.

PS: this PR should fix #10355

Description

I've added a new property to the Embed block's state to track whether the form has been submitted or not.

How has this been tested?

I've tested using this URL https://vimeo.com/287192106 which is an embeddable one within the Gutenberg Editor on WordPress trunk (as Gutenberg is not working on branch 5.0 of WordPress ??).
I've also ran the tests suite.

Screenshots

embeds-error-message
The error message

Gif about the confusing error message
The error message shows even if the URL is embeddable as the above GIF proves it.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

Testing Gutenberg 4.0.0-RC1 I noticed a confusing behavior about the Embeds blocks. As soon as you enter some content into the URL input there is an error message that is added under the URL input no matter if the URL is actually embeddable. I would suggest to wait untill the form has been submitted to eventually display this error. Otherwise some users like me might be confused to see this error although the URL is embeddable.

PS: this PR should fix #10355
@youknowriad
Copy link
Contributor

@notnownikki Does this ring any bell for you? Apparently, it's a 4.0 regression?

@youknowriad youknowriad added this to the 4.0 milestone Oct 17, 2018
@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release labels Oct 17, 2018
@notnownikki
Copy link
Member

Yeah, this was fixed by #10467 which finally moved the logic into the withSelect part instead of having it peppered over a few places in the edit component.

@gziolo
Copy link
Member

gziolo commented Oct 17, 2018

Let's wait for 4.1 to get this fixed with a much aggressive fix performed in #10467 by @notnownikki. Otherwise, we risk some bigger conflicts to have to resolve in both 4.0-RC and master.

Thanks @imath for spending your time on this PR. I will close it for now. We can always reopen if we change the way we publish 4.0 - by the way, it should happen today.

@gziolo gziolo closed this Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong behaviour when inserting URL's
4 participants