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
285
igDialog tabbing issue
posted

Hi,

When I open igDialog and start pressing tab button, focus goes to all of the parent controls first and then comes to igDialog content. How can I prevent this?

Problem is that if I press enter when focus is on parent page control, it triggers parent page actions. I don't want that to happen. Can you please quickly let me know if there is any simple CSS/JQuery trick to prevent focus going to parent page?

Thanks,

Manjunath M

Parents
No Data
Reply
  • 16310
    Offline posted

    Hello Manjunath,

    I suggest that you do not prevent other elements from getting focused but explicitly set focus on the dialog window when the tab key is pressed:

            $(document).on("keydown", function () {
                if (event.keyCode == 9) {                      // will return true when the Tab key has been pressed
                    $("#dialog").focus();                          // $("#dialog"). should return the DOM element where the igDialog is initialized
                }
            });

    Also make sure that the DOM element of the igDialog has tabIndex=0 attribute.

    Please try this and let me know if it helps.

Children