Gutenberg: Insert link warning (button block) and usability - consistency

Created on 3 Jul 2017  路  10Comments  路  Source: WordPress/gutenberg

Not sure what are the plans for the insert link "inline toolbar" or if this is already on the radar, so please close this issue if it's pointless.

Noticed two issues:

Button block: inserting the URL triggers a React warning:
As soon as I type the first character in the URL field:

screen shot 2017-07-03 at 16 48 44

Warning: A component is changing an uncontrolled input of type url to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component.
More info: https://fb.me/react-controlled-components
in input (created by edit)

Looks similar to #680

Usability/consistency:
When inserting a link on some selected text, the inline toolbar "Apply" button changes to an "Edit" button. The URL displayed in the toolbar is clickable and points to the linked resource, and clicking on "Edit" makes the URL editable again:

screen shot 2017-07-03 at 16 18 37

Instead, on the button block the behavior is different: after a link is inserted, the "Apply" button doesn't change. There's no "Edit" button and the URL displayed in the toolbar is always editable:

screen shot 2017-07-03 at 16 43 29

Not sure if there are technical reasons for this. ideally, the behavior should be similar. I can understand the button block doesn't necessarily need a "Remove link" button but I'd say the insert/edit user experience should be as similar as possible with the one of standard links.

Accessibility (a11y) Needs Design Feedback [Feature] Blocks

All 10 comments

+1 You should also be able to navigate to the page. :)

Yep! Also, editing an already inserted link with keyboard only is a bit hard right now. I guess that will improve with the introduction of a Cmd/Ctrl+K shortcut together with the other planned shortcuts, see #71

We have changed how the button urlInput looks, but it should also be more consistent functionality wise. Feel free to reopen if there are still concerns.

@mtias sorry maybe I'm missing something but I don't see relevant changes here. The button link inline toolbar and the normal link inline toolbar still work in a different way and would benefit from some better consistency.

Also, the JS warning is still there:
A component is changing an uncontrolled input of type text to be controlled.

_This ticket was mentioned in Slack in #core-editor by jeffpaul. View the logs._

Is this still something to consider in light of the changed to the link interface?

@karmatosed I see there are still at least 3 different types of UI to insert a link, see the ones on the blocks. I don't see a reason why they should be different, unless I'm missing something.

cover image:

cover block insert link UI

image:

image block insert link UI

paragraph (partially hidden by the following image block):

paragraph block insert link UI

button

button block insert link UI

@afercia I totally agree in unifying them to the new UI and we can using this as a starting point: https://github.com/WordPress/gutenberg/issues/6107

Unless I am wrong we should close this in light of the issue above. We can always reopen but lets make sure we get all the link interfaces unified there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorscode picture moorscode  路  3Comments

ellatrix picture ellatrix  路  3Comments

aduth picture aduth  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments

BE-Webdesign picture BE-Webdesign  路  3Comments