WordPress.org

Make WordPress Core

#19165 closed defect (bug) (fixed)

TinyMCE throws error on mousedown (error in wpEditImage)

Reported by: joehoyle Owned by: azaozz
Priority: normal Milestone: 3.3
Component: TinyMCE Version: 3.3
Severity: normal Keywords: has-patch
Cc:

Description

In trunk, a JS error in thrown in your mousedown on an element that is not an image and has no child elements.

This is due to the wpEditImage mousedown handler:

if ( e.target && (e.target.nodeName == 'IMG' || e.target.firstChild.nodeName == 'IMG') ) {

Steps to reproduce:

  1. Create a new post, paste the folling into the HTML view
    <input type="text" value="foo" />
    
  1. Switch to Visual, click on the input

Observed Result:
JS Error "Uncaught TypeError: Cannot read property 'nodeName' of null"

Attached patch to fix

Attachments (1)

19165.diff (677 bytes) - added by joehoyle 20 months ago.

Download all attachments as: .zip

Change History (3)

joehoyle20 months ago

comment:1 ocean9020 months ago

  • Milestone changed from Awaiting Review to 3.3
  • Owner set to azaozz
  • Status changed from new to reviewing

Related: r18702

comment:2 azaozz20 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In [19180]:

Fix js error on mousedown in the editor, props joehoyle, fixes #19165

Note: See TracTickets for help on using tickets.