gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Link modal closes upon typing into UrlInput when toolbar is docked to the paragraph

Open BoardJames opened this issue 9 years ago • 1 comments

Issue Overview

The link dialog only works when the toolbar is docked to the top. When the toolbar is docked to the block the link dialog is closed as soon as any attempt to type into it.

Steps to Reproduce (for bugs)

  1. Set the "Toolbar" setting to "Fix toolbar to block"
  2. Create a paragraph block and type some words.
  3. Place the cursor in the middle of a word and click the link button
  4. Try to type into the link URL input field.

I have replicated this in Chrome and Firefox on Linux Mint.

Expected Behavior

I expect that the link dialog will remain visible and the letters typed will appear in the URL input.

Current Behavior

The link dialog is closed immediately.

Possible Solution

I suspect this bug is being caused by the slot/fill system causing the events to be sent to a different element.

Screenshots / Video

link dialog closing when attached to the block

link-dialog-with-toolbar-on-block

link dialog working when docked to the top

link-dialog-with-toolbar-docked-to-top

Related Issues and/or PRs

No known related issues.

BoardJames avatar Dec 04 '17 03:12 BoardJames

Note that the initial suspicion was wrong. It was caused by the code that hides the toolbar during typing. As the key press events from the url input were going to the block they were triggering the toolbar hiding and as the url input is part of the toolbar it was getting hidden too.

BoardJames avatar Dec 04 '17 07:12 BoardJames