Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18625 closed defect (worksforme)

Dijit Time picker bug

Reported by: m.baldoncini Owned by: bill
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:


We found a bug on the time picker.

Before version 1.9 it's possible to set the visibleRange property, that loads and shows only the times comprised in the range; furthermore, there are two arrows above and below to scroll the hidden times.

Starting from version 1.9 it isn't possible to set the visibleRange property anymore: because of this, the select component is always filled with each time of the day: this causes slow loading when the times are configured with a small interval between each other.

Change History (6)

comment:1 Changed 4 years ago by bill

Resolution: worksforme
Status: newclosed

As explained in #18220, the time picker has been intentionally rearchitected, replacing the up/down arrows with normal scrolling, so thus the visibleRange property was intentionally removed.

Is your main issue performance? I do see an inefficiency in the current code. It would theoretically be faster if _getFilteredNodes() returned a DocumentFragment and _showText() just appended it to this.domNode all at once, rather than looping through each node.

comment:2 Changed 4 years ago by bill

I made the performance optimization at 50278e40c6b4c549f7ca1041e17890df521617af.

comment:3 Changed 4 years ago by m.baldoncini

Thank you for the code! Anyway, I've tried it and the performance issue is still there, there isn't any noticeable improvement from the previous version: I click on the time picker (5 minutes range) and it takes quite a bit to load the list, I click outside the time picker and it takes quite some time to hide itself; the same holds true when I select a value from the TimePicker?.

Perhaps the problem is due to the fact that every time is loaded at once? Did you notice the performance issue yourself? I'm testing it with Google Chrome 43, both on Windows and Linux.

comment:4 Changed 4 years ago by bill

OK, I see the slowness creating the picker, although no problem hiding it. I traced the JS and it seems like that dojo/date/locale.format() is slow, specifically from format() --> _getGregorianBundle() --> mixin().

Although lazy-loading the drop-down list is one option, that's too complicated. I have a simpler solution which I filed as #18629 and It gives about a 5x speed improvement.

comment:5 Changed 4 years ago by m.baldoncini

Great, I confirm that the GregorianBundle? caching is quite effective: the time picker drop down rendering speed is now acceptable. Thank you very much for your effort!

comment:6 Changed 4 years ago by bill

Good. Note that #18629 has now been pushed and backported.

Note: See TracTickets for help on using tickets.