WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 5 months ago

#46071 closed defect (bug) (fixed)

TinyMCE Classic Block: fix "Advanced Link" modal

Reported by: azaozz Owned by: azaozz
Milestone: 5.1 Priority: normal
Severity: normal Version: 5.0
Component: TinyMCE Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description (last modified by azaozz)

The "Advanced Link" modal doesn't work reliably in the Classic Block instance. Sometimes it doesn't insert a link, sometimes it inserts it at the beginning of the text instead of the cursor position.

This was reported for Gutenberg some time ago. See https://github.com/WordPress/gutenberg/issues/7932 and the 6-7 issues closed as duplicates. Opening this ticket here as it is an issue with one of our old custom TinyMCE plugins.

Attachments (1)

46071.diff (5.2 KB) - added by azaozz 11 months ago.

Download all attachments as: .zip

Change History (9)

@azaozz
11 months ago

#1 @azaozz
11 months ago

There are few reasons for these bugs. Most importantly the editor instance is inline and some "utility" functions work a bit differently.

In 46071.diff:

  • Refresh the wpLink modal and wplink editor plugin a bit.
  • Always select the (newly inserted or existing) link node after the modal has been opened. Passing it from the editor plugin breaks as the editor content is reloaded on editor.blur(), and opening the modal and clicking in it triggers that.
  • Remove outdated editor.focus() on opening the modal (was bad for accessibility).

Tested in Firefox, Chrome and Edge on Win10.

#2 @azaozz
11 months ago

  • Keywords has-patch added

#3 @azaozz
11 months ago

  • Description modified (diff)

#4 @iseulde
11 months ago

  • Keywords commit added

Ok, looks good.

#5 @azaozz
11 months ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 44696:

TinyMCE Classic Block: fix the Advanced Link modal (accessible when clicking on the cogwheel in the inline link modal in a Classic Block).

Fixes #46071.

#6 @ocean90
11 months ago

In 44699:

TinyMCE Classic Block: Remove unused variable.

See #46071.

#7 @noisysocks
6 months ago

#44348 was marked as a duplicate.

#8 @pento
5 months ago

#45678 was marked as a duplicate.

Note: See TracTickets for help on using tickets.