Opened 13 years ago

Last modified 11 years ago

#4409 closed defect

Safari: dijit.Editor dies while creating an unlabelled Button — at Initial Version

Reported by: guest Owned by: anonymous
Priority: high Milestone: 1.2
Component: Editor Version: 0.9
Keywords: Cc: [email protected]…, bill
Blocked By: Blocking:

Description

Hi all! I'm working towards getting dijit.Editor usable in Safari.

In dijit.form.Button:postCreate, the following call to dojo.trim fails:

dojo.trim(this.containerNode.innerText || this.containerNode.textContent); 

The reason for this is that in Safari this.containerNode.innerText returns an empty string. Safari then proceeds with this.containerNode.textContent and passes the result of this second call (undefined) to dojo.trim, where no typechecking is done and the call to undefined.replace fails. Unfortunately this transcends my javascript-foo. What's the canonical way to work around that kind of problem? (it seems that Safari treats an empty String as a false-value - is this a bug in Safari?) However, if I explicitly cast the argument, I get a step further:

dojo.trim(String('' || undefined)) 

Possible patch is attached.

Thanks in advance for your feedback, Hannes

Change History (1)

Changed 13 years ago by guest

Attachment: dojo.button.patch added
Note: See TracTickets for help on using tickets.