Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
WebDropDown doesn't lose focus in Chrome and Safari
posted

I have a problem with WebDropDown when using Google Chrome or Safari. Once I click inside the WebDropDown, or open the dropdown list, I can't focus on any other control in the page, like a TextBox. Only clicking on a control which causes a postback works.

Even managing che OnSelectionChanged event via Javascript and calling the blur() method doesn't work. When I try to click somewhere else in the page, the WebDropDown suddenly gains focus.

I tried writing a new blank project from Visual Studio and adding only a WebDropDown and a TextBox in the Default.aspx page to reproduce the problem. I attached the source code to this post (just the ig_res folder is missing because of the 200kb limit for attachment). With Internet Explorer and Firefox all works well, with Chrome and Safari is sufficient to click inside the WebDropDown, and then trying clicking on the TextBox, the focus remains to the DropDown.

Using ASP.Net 4.0 with Net Advantage 2011.2 SR 2086, Visual Studio 2010.

 

TestWDD.zip
Parents
  • 575
    posted

    I found the problem with some debug. In the WebDropDown script resource file there is a function called _onBlurHandler with these lines of code:

    // K.D. February 20th, 2012 Bug #100192 After scrolling down to the last item without selection control does not close the container when not in focus in Webkit browsers

    if ($util.IsWebKit) {
        this._elements["Input"].focus();
    }
    I tried bypassing this instruction and everything started working like a charm.
    Now, the question is: how can I override this behavior??? This make my application incompatible with Chrome and Safari...

Reply Children