Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#18495 closed defect (fixed)

Toaster does not accept 0 for duration with setContent

Reported by: szerfas Owned by: dylan
Priority: undecided Milestone: 1.7.9
Component: DojoX Widgets Version: 1.10.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by dylan)

In widget.Toaster.js if 0 is passed in for duration value the following evaluation will be run:

duration = duration||this.duration;

This will result in 0 being viewed as false and this.duration being used instead. This means the only way to used the valid value of 0 was to have the default set to 0. This seems like a design flaw because if most of your messages you want a default of some amount of time other then 0 you cannot make some messages like errors stay open with the value of 0. If the code checked for undefined instead and only use this.default in the case of undefined it would be possible to use 0.

Proposing swapping line 103:

duration = duration||this.duration;

to:

duration = duration == undefined ? this.duration : duration;

Change History (8)

comment:1 Changed 3 years ago by dylan

Milestone: tbd1.11
Owner: changed from dante to dylan
Status: newassigned

comment:2 Changed 3 years ago by dylan

Description: modified (diff)

comment:3 Changed 3 years ago by dylans <dylan@…>

Resolution: fixed
Status: assignedclosed

In 3e6db138f1f30564ede4a2f10b6608761824b8a5/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 3 years ago by dylans <dylan@…>

In 309230c30f12620edb5bccab688db05b45e66e0d/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 3 years ago by dylans <dylan@…>

In f8aeb67eb00bd2e1d68063cff3db0ab0c7e533af/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 3 years ago by dylans <dylan@…>

In 68a8b7a20a94efc2425a46781d305838d6f8b5cd/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 3 years ago by dylans <dylan@…>

In e9fac040771eb8d12ad7d6dee645d776430a18b6/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 3 years ago by dylan

Milestone: 1.111.7.9

Thanks for the fix szerfas! We hope you'll contribute more in the future.

Note that for fixes beyond simple one-liners, we'll require a CLA if you do not already have one on file ( see https://github.com/dojo/dojo/blob/master/CONTRIBUTING.md for more details).

Note: See TracTickets for help on using tickets.