This is a migrated thread and some comments may be shown as answers.

Remove tabindex=-1 from RadButton?

3 Answers 401 Views
Button
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 05 Mar 2013, 09:57 PM
Hi, after updating to q1 2013 set of controls I ran into issue with tabindex on the radbuttons. 
Buttons (more precisely - inputs that are hidden by span) by default are assigned tabindex -1. 
This causing these button to drop off from the page when user uses tab button on keyboard to navigate.
Now, i realize that I can specifically set tabindex for all buttons, however it is not feasible in our application - we simply don't know where those buttons will appear on the next page load and what index is to assign, so hard-coding tabindex is not an option.

I tried to remove these -1 with jQuery code, but for some reason it doesn't work in IE9, Firefox is ok though...

So the question is - is there a way to NOT assign  tabindex=-1 to the RadButtons and let browser handle keyboard navigation (or remove it after page is loaded, given that we don't know how many buttons there will be and where they will appear)?

3 Answers, 1 is accepted

Sort by
0
Accepted
Danail Vasilev
Telerik team
answered on 08 Mar 2013, 11:56 AM
Hi Alex,

I have already answered to your support ticket, so I'll answer this forum thread as well for the rest people in the forum.

Since Q1 2013 RadButton is rendered as an input wrapped inside of a span element. This change was essential in order for the RadButton to pass the Html5 validation. However, this leads to the following issues:
The first issue can be workaround by setting a tabindex of 0 to the RadButton with JavaScript as follow:
<script type="text/javascript">
    function pageLoad() {
    //Getting the button's wrapper
    button1 = $find("<%=RadButton1.ClientID %>");
    buttonWrapper = $telerik.$(button1.get_element());
 
    //Set tabindex attribute to the span element
    buttonWrapper.attr("tabindex", "0");
}
</script>

The priority of both issues have been raised, so that if everything is fine they might be fixed for the Q1 2013 SP1.

Please accept our apologies for the caused inconvenience

Greetings,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Cheri
Top achievements
Rank 1
answered on 14 May 2013, 03:18 PM
Hello,
I've run into the exact problems as described in this thread.  I used the javascript provided by Danail to set focus on my rad button but that button still does not recognize a click event generated when the user presses "enter" on his keyboard.

This is a big issue for my organization and the upgrade to 2013 Q1 has proven, in this instance, to be a real step back.  My users need the ability to navigate through out the application using only their keyboards. 

Is there another work around that will register the click event when the user presses "enter"?  The link provided by Danail says "FIX" in its title and when I click on the link it has a status of "completed" but I'm not seeing where or how?  What am I missing?  Is this part of the hot-fix for Q1?

I am using IE 8.  Upgrading to a more recent version is not an option.

Please help!
0
Danail Vasilev
Telerik team
answered on 17 May 2013, 01:41 PM
Hi Cheri,

We are aware of an issue with the triggering of the server-side OnClick event of the RadButton with the enter key when the following conditions are met:
  • A client-side OnClientClicking event is used and triggered
  • a dialog is opened in the OnClientClicking event

If you hit again the enter key the server-side OnClick executes.

The workaround is to use either the OnClientClicked event or perform a server-side click of the button after the dialog's opening in the OnClientClicking event.

This issue is different than the listed ones and has been logged in our feedback portal here, so that you can track, comment or vote on it.

If your issue, however, is different than the described one, could you please provide more information about it, or open a support ticket, so that we can proceed further with the investigation?


Kind regards,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Button
Asked by
Alex
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Cheri
Top achievements
Rank 1
Share this question
or