Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#6489 closed defect (fixed)

1.0 Breaking API change in dijit.form.TextBox

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.1.1
Component: Dijit - Form Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:


1.0 Breaking API change in dijit.form.TextBox?

In 1.0.2, dijit.form.TextBox? had a public function, onkeyup, that was called anytime a key event occurred in the textbox. The demo:

dojox/wire/demos/markup/demo_ConditionalActions.html made use of this event to mirror content on each keypress.

In 1.1, this API is flat *gone* and no onkeyup events are occurring anymore. Since this was a public API on the class (no _), this constitutes a breaking API change and should be corrected.

Change History (12)

comment:1 Changed 14 years ago by Jared Jurkiewicz

This broke a bunch of dojox.wire demos, which is hwo ti came to my attention. Namely, it broke:

dojox/wire/demos/markup/demo_ConditionalActions.html dojox/wire/demos/markup/demo_ActionChaining.html dojox/wire/demos/markup/demo_TopicWiring.html

All of which used TextBox? and listened for keyup events to drive dynamic page changes, topic publishes, etc.

comment:2 Changed 14 years ago by Douglas Hays

Owner: set to Douglas Hays
Priority: normalhigh

The onChange with intermediateChanges=true was designed for this, but that's not working. I'll target fixing onChange for 1.2 since it was already broken in 1.0 (the root cause of having to use onkeyup). Bill never intended onkeyup to be part of the public API, but rather a missing underscore on a private function name. It's also very hard to deprecate an event handler since users could be connected to the method and thus no way to notify them to not do that. I'll reference this defect and put the onkeyup function back in for 1.1.1.

comment:3 Changed 14 years ago by Jared Jurkiewicz

The workaround I can use temporarily is to connect to: widget.domNode.onkeyup to get the same behavior back.

But, for reference, outside of the four demos this broke, it also breaks two known applications as well and potentially others. So, it's good to get the api back into 1.1.0. Thank you for that.

comment:4 Changed 14 years ago by Douglas Hays

(In [13316]) References #6489. Restore onkeyup to textbox subclasses to prevent backward compatibility break.

comment:5 Changed 14 years ago by Douglas Hays


comment:6 Changed 14 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

#6306 is fixed in 1.2 and adds support for intermediateChanges=true for the textbox widget set. Any uses of onkeyup to track changes should be using this method instead for 1.2. Adding support for all the on* events will be addressed by #5417. So this ticket can be closed as fixed in 1.1.1.

comment:7 Changed 14 years ago by dante

Resolution: fixed
Status: closedreopened

Is this really fixed? Checking the mentioned demo's still seems broken, but maybe I'm just misunderstanding what's going on here. in 1.1.1 onkeyup is back, but not in 1.2? intermediateChanges=true is the solution? }}}

is there a testcase for onkeyup anywhere? i wasn't able to find one offhand. looking at the textBox template in [13316] it looks like you restored onkeyup firing to an onkeypress event, but in 1.0 it seems like it was attached to both onkeyup and onkeypress 

comment:8 Changed 14 years ago by dante

sorry for my broken comment, unclosed brackets.

the changeset [11677] is where i see the onkeyup,onkeypress:onkeyup

vs [12572]

comment:9 Changed 14 years ago by Douglas Hays

Owner: changed from Douglas Hays to Jared Jurkiewicz
Status: reopenednew

Existing uses of onkeyup to track onchange events should be changed to use intermediateChanges=true in dojo 1.2.

comment:10 Changed 14 years ago by Jared Jurkiewicz

Priority: highnormal

comment:11 Changed 14 years ago by dante

Priority: normalhigh
Resolution: fixed
Status: newclosed

comment:12 Changed 11 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.