Ticket #6489 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

1.0 Breaking API change in dijit.form.TextBox

Reported by: jaredj Owned by: jaredj
Priority: high Milestone: 1.1.1
Component: Dijit Version: 1.1.0
Severity: normal Keywords:
Cc:

Description

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

Changed 8 months ago by jaredj

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.

Changed 8 months ago by doughays

  • priority changed from normal to high
  • owner set to doughays

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.

Changed 8 months ago by jaredj

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.

Changed 8 months ago by doughays

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

Changed 8 months ago by doughays

  • milestone changed from 1.1.1 to 1.2

Changed 8 months ago by doughays

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.2 to 1.1.1

#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.

Changed 7 months ago by dante

  • status changed from closed to reopened
  • resolution deleted

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?

http://dojotoolkit.org/forum/dojox-dojox/dojox-support/wireml-problems-w-demos-dojo-1-1#comment-14773 }}}

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 

Changed 7 months ago by dante

sorry for my broken comment, unclosed brackets.

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

vs [12572]

Changed 7 months ago by doughays

  • status changed from reopened to new
  • owner changed from doughays to jaredj
  • milestone changed from 1.1.1 to 1.2

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

Changed 7 months ago by jaredj

  • priority changed from high to normal

Changed 7 months ago by dante

  • priority changed from normal to high
  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.2 to 1.1.1
Note: See TracTickets for help on using tickets.