#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 )
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 5 years ago by
Milestone: | tbd → 1.11 |
---|---|
Owner: | changed from dante to dylan |
Status: | new → assigned |
comment:2 Changed 5 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 Changed 5 years ago by
Milestone: | 1.11 → 1.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).
In 3e6db138f1f30564ede4a2f10b6608761824b8a5/dojox: