Gutenberg: Components: URL input popover animates repeatedly on text/selection change

Created on 8 Apr 2019  路  4Comments  路  Source: WordPress/gutenberg

Previously: #13617

Describe the bug

When changing the text within a linked segment, or moving the selection caret using arrow keys, the link popover animates repeatedly.

To reproduce

  1. Navigate to Posts > Add New
  2. Click the writing prompt
  3. Insert some text
  4. Apply a link to said text
  5. Select within the linked fragment of text
  6. Change the linked text, or simply use arrow keys within to change caret position
  7. Note that the popover animates in response to each input

Expected behavior

The Popover should only animate once when first shown, not on input.

Screenshots

url-animation

Desktop:

  • OS: macOS Mojave 10.14.4 (18E226)
  • Browser: Chrome Version 73.0.3683.103 (Official Build) (64-bit)
  • Version: master (1df302121f0ab7df8611d01e28ad41db25f40d52)
[Feature] UI Components [Package] Components [Type] Bug

All 4 comments

I guess it would be best for the toolbar to be positioned relative to the link element, _not_ the caret. Happy to look into it.

I guess it would be best for the toolbar to be positioned relative to the link element, _not_ the caret. Happy to look into it.

I hadn't considered that (vs. just preventing the repeated animation), but that sounds both a general improvement and likely solution to the bug!

I'll have a look at this as well unless someone figures it out before I'm able to start looking into it. First looking into #14871.

There's a related issue that I made a while back - https://github.com/WordPress/gutenberg/issues/11092

Back then I tried to resolve the problem by aligning the popover to the formatting boundary, but a separate issue made it hard to implement - https://github.com/WordPress/gutenberg/issues/11091. Now that's resolved it should be a bit easier.

Was this page helpful?
0 / 5 - 0 ratings