Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15197 closed defect (fixed)

Rapidly clicking on DateTextBox in IE 8 throws error pop up message "Can`t move focus to the control because it is invisible... dojo.js"

Reported by: kumarann Owned by: bill
Priority: undecided Milestone: 1.8
Component: Dijit - Form Version: 1.6.1
Keywords: Cc: Douglas Hays
Blocked By: Blocking:

Description (last modified by bill)

Steps to reproduce the error

1) Create a simple html page containing DateTextBox control.

2) Open the page in IE 8.

3) Rapidly click (3-4 clicks) on the date text box.

It throws up an error pop up with message "Can't move focus to the control because it is invisible... dojo.js"

Attachments (4)

hello.html (504 bytes) - added by kumarann 7 years ago.
focusCloseRaceConditionFix.patch (1020 bytes) - added by bill 7 years ago.
possible fix
_HasDropDown.js (14.0 KB) - added by sivakannan 7 years ago.
_HasDropDown.js in dojo 1.6.1
testhtml.html (2.7 KB) - added by sivakannan 7 years ago.

Download all attachments as: .zip

Change History (15)

Changed 7 years ago by kumarann

Attachment: hello.html added

comment:1 Changed 7 years ago by kumarann

Have attached a sample html page (hello.html) containing DateTextBox? control to reproduce the issue.

comment:2 Changed 7 years ago by Douglas Hays

Owner: changed from Douglas Hays to bill
Status: newassigned

Hard to recreate but definitely possible (eventually). CalendarLite?._setCurrentFocusAttr contains
newCell.focus();
but that isn't protected by a try/catch. Also I'm not sure if focus should be changed then or should have been deferred until the event handler finishes.

Changed 7 years ago by bill

possible fix

comment:3 Changed 7 years ago by bill

I think it's another problem with timeouts, specifically that:

  1. the drop down is opened
  2. a focus timer is set
  3. the drop down is closed
  4. the focus timer fires

It's hard to confirm though since this problem is so intermittent. Could one or both of you try attachment:focusCloseRaceConditionFix.patch to see if it fixes the problem for you?

comment:4 Changed 7 years ago by bill

Cc: Douglas Hays added

Doug -- see above ^^^

comment:5 Changed 7 years ago by Douglas Hays

I no longer see the exception after applying the patch

comment:6 Changed 7 years ago by bill

Milestone: tbd1.8

comment:7 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28454]:

Fix race condition where drop down closes before focus timer fires, fixes #15197 !strict.

comment:8 Changed 7 years ago by sivakannan

In the _HasDropDown.js line number 141 contains window.setTimeout(dojo.hitch(dropDown, "focus"), 1); but in the fix, this.defer has been used. It is not working with my code.

Changed 7 years ago by sivakannan

Attachment: _HasDropDown.js added

_HasDropDown.js in dojo 1.6.1

Changed 7 years ago by sivakannan

Attachment: testhtml.html added

comment:9 Changed 7 years ago by bill

this.defer() was added in trunk, for dojo 1.8. Apparently you are trying to use the _HasDropDown.js from trunk against dojo 1.6.1. This is not expected to work.

comment:10 Changed 7 years ago by mangaya

This issue occurs in Dojo version 1.7.2, do you have patch or fix for that version too

comment:11 Changed 7 years ago by bill

Description: modified (diff)

No, but it's trivial to do yourself. Just change the this.defer() to a setTimeout(), and the this._focusDropDownTimer.remove() to a clearTimeout(this._focusDropDownTimer).

Or alternately, even easier, add the defer() method from 1.8 into _WidgetBase.js.

Note: See TracTickets for help on using tickets.