Opened 5 years ago

Closed 5 years ago

#17756 closed defect (invalid)

_FormSelectWidget value setter does not handle empty arrays correctly

Reported by: fvanham Owned by: fvanham
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.9.3
Keywords: Cc:
Blocked By: Blocking:

Description

Trying to clear the selection of a _FormSelectWidget descendant by setting the value to an empty array []. While the value store is updated correctly, these results are not visible in the UI. I believe these lines to be at fault:

...
var val = array.map(newValue, function(opt){
	return opt.value;
});
if(typeof val == "undefined" !|| typeof val![0] == "undefined"){
	return;
} // not fully initialized yet or a failed value lookup
...

When newValue is the empty array val will be an empty array and typeof val[0] will be undefined, resulting in an early function exit, without updating the UI.

Change History (2)

comment:1 Changed 5 years ago by bill

Owner: set to fvanham
Status: newpending

Could be. But I can't check because don't have any descendants of _FormSelectWidget except for Select itself, where value is scalar (rather than an array). So, please attach a test case using the "attach file" button, with instructions including expected results vs. actual results.

comment:2 Changed 5 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.