Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12999 closed defect (fixed)

[25033] does not allow some function definitions from markup

Reported by: Douglas Hays Owned by: bill
Priority: blocker Milestone: 1.7
Component: Dijit Version: 1.6.1
Keywords: Cc: Chris Mitchell, pruzand@…
Blocked By: Blocking:

Description

Given

function keypressed(){
        console.log('keypressed');
}
and
<textarea dojoType="dijit.form.SimpleTextarea" onKeypress='keypressed' >text</textarea>

an exception is thrown:
uncaught exception: dojo.hitch: scopekeypressed? is null (scope="[Widget dijit.form.SimpleTextarea?, dijit_form_SimpleTextarea_0]")
This worked before [25033].

Change History (3)

comment:1 Changed 8 years ago by Douglas Hays

Cc: Chris Mitchell pruzand@… added

comment:2 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

(In [25056]) Revise "deferred connect" refactor to use stub functions again (like in 1.6), so that parser knows that onMouseMove etc. is a function. Refs #12986, fixes #12999 !strict.

comment:3 Changed 8 years ago by bill

(In [25304]) Fix context passed to handler for deferred connections, ex: dojo.connect(widget, "onMouseEnter", myFunc). It should be widget (ie, inside of myFunc(), this == widget). Note that new Widget({onMouseEnter: myFunc}) was already working that way. Also, the above dojo.connect() wasn't being handled correctly except on IE because we weren't running the normalization code to map onmouseenter --> onmouseover. Likewise for onkeypress. This checkin fixes test failures in DateTextBox.html on hovering the various widgets. Would be nice to add a more direct test though. Refs #12999 !strict.

Note: See TracTickets for help on using tickets.