Vaain 7.3.0 - auto ESCAPE KEY shortcut for closable Windows?

Hi Guys.

Looking for a simply answer. Is this new behaviour intended?

It appears as though the default behaviour for a new window - or any window that is setClosable(true) - automatically creates an ESCAPE KEY shortcut on the window.

This caused us problems with out application, which was structured as follows:

  1. Browser window.
  2. Modal Base window - CLOSABLE.
    3. Modal Sub Window - NOT CLOSABLE, but with ESCAPE KEY registered as a shortcut to a ‘close’ button (ie we handle our own closing).

When the escape key is pressed on window 3, window 2 now also appears to capture the ESCAPE KEY being pressed, and also closes. I worked around this by setting Window 2 as not closable.

So is it intentational that the ESCAPE KEY shortcut for a closable window is now automatically registered by Vaadin?

In our application we have option in config file - what sortcut use to close dialogs. We disabled default behaviour in our descendant of VWindow (just override onKeyUp method with empty body).

I think it should be optional behaviour, I was very confused after migration to 7.3.

A ticket has been created for this issue As a temporary workaround, I guess a JS extension to intercept key events could be used, but I haven’t had the time to test this myself so far

While waiting for the fix to make it to an actual core version, a quick solution is to extend both VWindow with overridden onKeyUp() without a super call, and WindowConnector with the same @Connect(value = com.vaadin.ui.Window.class) annotation that the super class has, and an overridden getWidget() that points to your extended VWindow. There is no need to extend the server-side, the extended versions of the VWindow and WindowConnector shall be used automatically when you recompile your widgetset (as long as the extended classes are contained within a ‘client’ package under the package of your .gwt.xml file – the usual requirement for client-side classes). You won’t need to change any imports or such within your project, and you can merely delete the extended classes when we get a fixed version out.

Note: this removes the accessibility shortcut completely from all of your Window instances, and you’ll need to add it manually if you want to have it there.