Monday, March 26, 2012

Tab Order (TabIndex)

Has anyone else noticed that in the PopupControlExtender example, if you use the mouse to click on a date, then press Tab thinking you're going to the next control in the TabIndex order, than in fact you start back at the top of the TabIndex order.

For example, I have a table with several TexBox controls on it. Half way across the table's columns, I have a date field that is hooked up to a popup calendar. If I type the date in, and Tab - I go to the next field as expected. If, however, I use the mouse to click on a date on the calendar popup - then press Tab, I'm taken to the start of the table's fields again.

Is there any way to have better control over the TabIndex order here?

Is the situation any better with the 60504 release of the PopupControl? I know Ted made some tabbing changes there so it was possible to tab into the popup...

You can now tab into a textbox and the control will pop up. When you tab out of the textbox, the popup control will not go away, unless you click with your mouse somewhere outside of the textbox/popup control. It would be useful if you could tab in and have the popup control appear, and tab out and have it disappear.


This stems from the inability to find out where focus has gone to in the browser. We can be notified of the lost focus (onblur) on the textbox, but there's no way of knowing where it's gone to. It could be another control on the page, it could be the popup itself, there's no way to tell. Unfortunately the focus management facilities of the DOM are a little lacking.

So that complicated doing this in a clean way. We talked about catching the onkeydown and looking specifically for tab on the textbox but it seemed hacky. If enough people complain, maybe we'll revisit it.


Hey sburke,

I realize this post is old, but I'm just wondering if enough people complained :P

I did use your onkeydown hack to fix the buggyness in the popupcontrolextender SampleWebSite that comes with the control toolkit. However, I also needed to create an onfocus event for the textboxes b/c after setting a Panels display=none when tabbing out, if I shift-tabbed back into the field the popup wouldn't show. This leaves the popupcontrolextender actually doing little more than setting some positional attributes, which I could easily add to my javascript function.

This may have been addressed elsewhere, but are there any new plans on "fixing" this? Or perhaps someone has come up with a better workaround than the onkeydown method... ??

Thanks.

--c--


sorry, make that [visibility=hidden], not [display=none]

No comments:

Post a Comment