#12645 closed enhancement (fixed)
Select: focus selected value when opening dropDown
Reported by: | Karl Tiedt | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Dijit - Form | Version: | 1.6.0 |
Keywords: | dijit.form.Select dropdown focus | Cc: | |
Blocked By: | Blocking: |
Description
Native <select>s when you open them w/a long list, always focuses to the current value, however dijit Select does not... it always sets the dropdown scroll to the first element in the dropdown
Hot fix currently implemented to achieve this:
(function(Select) { Select._odd = Select.openDropDown; Select.openDropDown = function() { this._odd.apply(this, arguments); this.dropDown.focus = function() { var s = dojo.filter(this.getChildren(), function(o) { return o.option && o.option.selected; })[0]; if (s) { this.focusChild(s); } else { this.focusFirstChild(); } } } })(dijit.form.Select.prototype);
Thoughts/opinions?
Change History (6)
comment:1 Changed 10 years ago by
Summary: | dijit.form.Select does not focus current value when opening dropDown → Select: focus selected value when opening dropDown |
---|---|
Type: | defect → enhancement |
comment:2 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|
comment:3 Changed 10 years ago by
Milestone: | 1.7 → 1.8 |
---|
comment:5 Changed 8 years ago by
Good day!
Hi there in Dojo land. My name is Mike, and I am a software developer in Denver, Colorado. I am currently working with a client who is experiencing the above-described problem in Dojo 1.6.1, and unfortunately they are not in a position to upgrade their enterprise to 1.8 in order to get the fixed code.
In the ticket above, I see that there is a "hot fix" patch mentioned. I'd love to be able to provide that exact hotfix to my client, but- I'm not at all sure where in the Dojo code to make the change. We've been searching through the 1.6.1 Dojo source, but haven't had any luck.
If someone out there happens to know where in the 1.6.1 code that hotfix goes, and could point me at it, we would REALLY appreciate it (and if you happen to be in Denver, I'll even offer to buy you a few beers).
Thanks!!! -Mike
comment:6 Changed 8 years ago by
That hotfix goes in the client code, not the dojo code. This is known as "monkey-patching".
I thought we had a ticket about this but can't find it now. Maybe it was about FilteringSelect and got closed because it was impossible/impractical with the dojo.data API.