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

Insert link: validation and feedback #1838

Closed
afercia opened this issue Jul 10, 2017 · 9 comments
Closed

Insert link: validation and feedback #1838

afercia opened this issue Jul 10, 2017 · 9 comments
Assignees
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Priority] High Used to indicate top priority items that need quick attention

Comments

@afercia
Copy link
Contributor

afercia commented Jul 10, 2017

Splitting this out from the first accessibility testers group report, but not strictly related to a11y:

When inserting a link, if I don’t type a URL address beginning with http://, Voiceover announces that the data is invalid. The insert link object keeps announcing “Enter a URL” like if any text were already typed. There is not a proper message to explain the user why the data is invalid or a placeholder (or something else) to show the expected input format.

In the current WordPress editor, there's some simple, basic check on the inserted URL format. If the check detects a potential malformed URL, there's a visual feedback. Also when the link is not selected, it is highlighted with some "warning" styling:

screen shot 2017-07-10 at 16 59 05

screen shot 2017-07-10 at 17 00 26

There's also an assertive aria-live message as audible feedback, see:
speak( editor.translate( 'Warning: the link has been inserted but may have errors. Please test it.' ), 'assertive' );

Instead, in Gutenberg the link field uses the required attribute and thus relies on client-side validation which is inconsistent across browsers, and doesn't give a proper feedback. This is what happens in Chrome (note: at the time of writing, the insert link doesn't work at all in Firefox):

screen shot 2017-07-10 at 17 12 20

In this case Chrome doesn't say anything useful. I'd say the visual feedback is not so useful for all users, not just assistive technologies users.

It would be great to implement some validation/feedback mechanism to have feature parity with the current editor.

Also, a a proper placeholder used to give a hint about the expected format could help. Something like: http://example.org. However this depends on future plans for the insert link functionality: will a search be implemented?

@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Jul 10, 2017
@mtias mtias added Browser Issues Issues or PRs that are related to browser specific problems [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Nov 20, 2017
@afercia
Copy link
Contributor Author

afercia commented Jul 2, 2018

I've just tested this and I was able to enter a link like:
<a href="http://asdasdasd">blabla</a>

So apparently there's no validation at all. Also, no visible or audible feedback.

Seems to me this should be addressed before releasing... /Cc @mtias

@afercia
Copy link
Contributor Author

afercia commented Jul 2, 2018

See also #1867 it would be nice to have it in the release, together with some form of validation.

@aaronjorbin
Copy link
Member

This is a regression from the current editor.

@mtias
Copy link
Member

mtias commented Nov 12, 2018

Closing as implemented in #11286. Let's open any pending improvements, ideas, and enhancements elsewhere.

@mtias mtias closed this as completed Nov 12, 2018
@gziolo
Copy link
Member

gziolo commented Nov 12, 2018

@talldan - did you open a follow-up for the missing red dots around invalid link? It's a minor thing but I remember it was discussed in the PR where this feature was ported from the Classic editor.

@talldan
Copy link
Contributor

talldan commented Nov 13, 2018

Hey @gziolo - I created this issue to cover the changes required in the format api:
#11484

Will open some more issues today to cover other link validation improvements and link to them here.

@melchoyce
Copy link
Contributor

If I were to try to improve this design, where should that go? I see a number of issues/PRs around this topic.

@talldan
Copy link
Contributor

talldan commented Nov 16, 2018

Hi @melchoyce #11796 is the one you're after. Thanks!

@melchoyce
Copy link
Contributor

Thanks Dan!

Tug pushed a commit that referenced this issue Feb 28, 2020
* update ref

* Update ref

* update ref

* update ref

* update ref

* update ref to master (adjust vertical margins)

* update ref

Co-authored-by: Luke Walczak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Priority] High Used to indicate top priority items that need quick attention
Projects
None yet
Development

No branches or pull requests

6 participants