Results 1 to 2 of 2

Thread: Modal dialogs can be bypassed

    You found a bug! We've classified it as EXTGWT-2149 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Vote Rating

    Default Modal dialogs can be bypassed

    System: GXT 3.0.1/3.0.4; IE 9/Firefox 10.0.4

    Modal dialogs can be bypassed by using the tab key multiple times to move through all the masked form elements on the page.
    This behavior can be reproduced using an example from the GXT showcase (click the Hello World world button and then tab youll find the search input field at the top left focused):

    It seems that you've fixed this issue in Ext JS recently:

    Your showcase confirms the correct behavior:!...tact-form.html

    It would be great to have a fix in GXT, too!

  2. #2
    Sencha - Support Team
    Join Date
    Jan 2012
    Arlington, WA
    Vote Rating


    This should could be a workaround:

    1. Add a method to tell if the element is coming from the Window
    private boolean isWindowEvent(Element element) {
      do {
        EventListener eventListener = DOM.getEventListener(( element);
        if (eventListener instanceof Window) {
          return true;
        element = (Element) element.getParentElement();
      } while (element != null);
      return false;
    2. Preview the events when the window is open and visible. And this will ignore tab events coming from everything but the window.
    Event.addNativePreviewHandler(new NativePreviewHandler() {
      public void onPreviewNativeEvent(NativePreviewEvent event) {
        String type = event.getNativeEvent().getType();
        EventTarget et = event.getNativeEvent().getEventTarget();
        Element element = et.cast();
        // ignore tab keys when not in window
        if (modalWindow != null && modalWindow.isVisible() && type.contains("key")
            && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_TAB && !isWindowEvent(element)) {

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts