Wp-calypso: Gutenberg: Adding link on Paragraph block breaks the block on Safari

Created on 10 May 2019  路  5Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Open your WordPress.com account on Safari.
  2. Go to Site > Pages.
  3. Create a new page.
  4. Add a text using a Paragraph block.
  5. Select part of the text and hyperlink it.

I was able to replicate the above on an AT and Simple site.

What I expected

The link to work.

What happened instead

It breaks the block.

Browser / OS version

Safari Version 12.1 (13607.1.40.1.5)
OS X 10.13.6

Screenshot / Video

GutenIssue

This is what it shows in the Console:

Screen Shot 2019-05-10 at 17 27 38

Context / Source

user-report

2017169-zen

[Goal] Gutenberg [Pri] High [Type] Bug

Most helpful comment

D28094-code has a temporary fix for WP.com sites while we wait for changes from https://github.com/WordPress/gutenberg/pull/15576

All 5 comments

Verified on Simple/Atomic but not in Gutenberg nightly.

It's more specifically breaking on window.getSelection().getRangeAt(0)
Screen Shot 2019-05-10 at 1 49 09 PM

Which I think lines up with https://github.com/WordPress/gutenberg/blob/4108e37d3771b5871cd720216432b5bbd5255551/packages/format-library/src/link/inline.js#L82

Update: I can reproduce this in Gutenberg master with the following steps:

In Safari:

  • Add a link to a paragraph
  • Click on another paragraph
  • Click directly on the link you added

May-10-2019 14-49-33

D28094-code has a temporary fix for WP.com sites while we wait for changes from https://github.com/WordPress/gutenberg/pull/15576

Fixed by D28094-code.

Created https://github.com/Automattic/wp-calypso/issues/33004 as a reminder to revert D28094-code during the next Gutenberg update in WP.com sites.

Was this page helpful?
0 / 5 - 0 ratings