Gutenberg: Unable to insert links when clicking on an autocomplete suggesion

Created on 11 Oct 2018  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug
When I insert a link nothing happens

To Reproduce

  1. add paragraph
  2. select text and click add link
  3. trigger the autocomplete dropdown
  4. Click on a dropdown item

This has not been a problem in previous versions

Screenshots
linkinsert

Desktop (please complete the following information):
Chrome
4.0 rc

[Feature] Writing Flow [Type] Bug

All 5 comments

Looks like it's an issue when using the mouse to select an option from the dropdown. Using the keyboard to select a dropdown item is fine, as is entering a url manually.

@slimmilkduds If it's ok with you, can I rename the issue?

The issue is that onClickOutside is being triggered when clicking on one of the autocomplete suggestions here:
https://github.com/WordPress/gutenberg/blob/f2da3e5a069c4992903be5e179f4a3ddb126f400/packages/editor/src/components/rich-text/format-toolbar/link-container.js#L176-L180

Because the dropdown suggestions aren't rendered as a direct descendent of the link-container popover, it's detected as a valid click outside.

I'm a bit surprised to find that the list is not the same component as the autocomplete one.

Thanks for the report @slimmilkduds! The fix has now been merged and the release for 4.0 will be patched with the fix.

Great!

Was this page helpful?
0 / 5 - 0 ratings