Opened 4 years ago

Last modified 18 months ago

#18622 assigned defect

Cannot single-select after multi-selecting (dojox/Selection.js)

Reported by: inanutshellus Owned by:
Priority: undecided Milestone: 1.14
Component: Dojox Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:


Widgets using dojox/Selection.js, such as dojox/Calendar, suffer from an issue when multi-selecting. Once you've multi-selected an item, the last item cannot be single-selected with left-click.

Steps to reproduce: 1) Pull up a calendar with three items Foo, Bar and Baz. 2) Left-click Foo 3) Control-click Bar 4) Control-click Baz 5) Decide you want to un-select Foo and Bar, and only have Baz selected. So normal-left-click Baz.

Expected: Only Baz is selected. Actual: Foo, Bar, Baz are all selected. You must click on something else (e.g. Foo) then click Baz in order to select Baz only.

Here's a demo:

FWIW, the problem is in dojox/widget/Selection's selectFromEvent function. It does this:

    this.dispatchChange(oldSelectedItem, this.get("selectedItem"), renderer, e);

The problem is that oldSelectedItem and this.get("selectedItem") are Baz. Thus, everyone relying on dispatchChange says "Oh, the old thing was Baz, the new thing is Baz, so no change happened."

Instead, dispatchChange should send all of the previously-selected items, not just the last-selected element.

Change History (2)

comment:1 Changed 3 years ago by dylan

Milestone: tbd1.12
Owner: Adam Peller deleted
Status: newassigned

comment:2 Changed 18 months ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.