SeaUrchinBot / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Javascript error in Webkit while clicking the link button in the rich text editor #282

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Go to 
http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/editor/editor
.html
2. Select the empty space in the 'Current field contents' field. (make sure 
that this field not only holds the focus but also that the empty space is 
selected - you should see it highlighted) 
3. Click the link button in the richt text editor

What is the expected output? What do you see instead?

In Firefox and IE, you will see the LinkDialog popping up. In Safari and 
Chrome, you get a javascript error:
Uncaught TypeError: Cannot set property 'href' of null in link.js line 89

What version of the product are you using? On what operating system?

I was able to reproduce this with revision r683 and r305 in Safari5 and Chrome9

Original issue reported on code.google.com by jtuchsch...@rallydev.com on 1 Mar 2011 at 11:04

GoogleCodeExporter commented 8 years ago
It looks like Webkit isn't focusing the field after the call to focusField_ in 
basictextformatter.js. The subsequent call to this.getRange_() then returns 
null, resulting in the error.

Ideally the focus issue should be fixed but in the meantime, checking for range 
!= null would at least stop the errors.

Original comment by jl...@google.com on 8 Mar 2011 at 9:04

GoogleCodeExporter commented 8 years ago

Original comment by pall...@google.com on 15 Jul 2011 at 1:34