Keyboard only nagivation, tab traversal, and modal windows


I have a problem with tab traversal when a modal window is displayed. My application consists of a main window, where all interactive components can be accessed from the keyboard by repetitively pressing the Tab key. I also use keyboard shortcuts extensively (via Window.addActionHandler()).

My application also pops up modal windows which serve as dialogs (mostly confirmation dialogs). I have two issues with tab traversal when a dialog box is shown:

  1. The dialog window does not have the focus by default, and does not answer to keyboard shortcuts. (I registered a second set of keyboard shortcuts that are valid only in the modal window with the modal window itself). Primarily, I want the window to react to the Enter button (‘OK’), and Escape (‘Cancel’).

  2. While it is possible to force an element (button) in the modal window to gain focus (e.g., by calling focus() on the element), the first tab press causes the focus to go to a component that exists in the main application window (outside of the modal window). Since the dialog window is modal, that component in the main application window cannot accept any input (as it should), but it also traps the focus (i.e., you cannot press tab to proceed further). This effectively makes impossible to use tab to navigate among the components within the modal window.

Am I making anything wrong? What is the proper way to handle keyboard-only navigation in Vaadin? Is there any work-around to the issue I have described?

Any help would be greatly appreciated!


Any chance to get this bug fixed? It is reproducible with Vaadin 7.1.9 and latest browsers (Chrome, Firefox). I’ve found some tickets (1, 2) and some attempt to fix (at least partially) this bug (3) - Vaadin 6.x anyway.

This bug seriously hampers keyboard navigation, which is common with data centric applications.