Results 1 to 7 of 7

Thread: [4.0.6] Two Windows with modal ESC close wrong window

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2008
    Location
    Dsseldorf, Germany
    Posts
    40

    Default [4.0.6] Two Windows with modal ESC close wrong window

    I have a modal window which open an other modal window. On press ESC the first window in the back close and not the Window in front.

    Notice: I use the sandbox

  2. #2
    Ext JS Premium Member
    Join Date
    Nov 2008
    Location
    Dsseldorf, Germany
    Posts
    40

    Default

    Temp Fix:

    Code:
    
    
    Ext4.override(Ext4.window.Window, {
        onEsc: function(k, e) {},
        afterRender: function() {
            this.callOverridden(arguments);
            
            this.getKeyMap().on(27, function(k, e){
                var activeWindow = Ext4.WindowManager.getActive();
                if (activeWindow.closable) {
                    e.stopEvent();
                    activeWindow[activeWindow.closeAction]();
                }
            });
        }
    });

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Does it work without using sandbox?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #4
    Ext JS Premium Member
    Join Date
    Nov 2008
    Location
    Dsseldorf, Germany
    Posts
    40

    Default

    No I am sorry it do not work.

    Here is a litle testcase:

    Code:
    Ext.onReady(function(){
        var win1 = Ext.create('widget.window', {
            height: 400,
            width: 400,
            title: 'Window 1',
    		html: 'Content Window 1',
    		modal: true,
    		buttons: [{
    			text: 'Show Window 2',
    			handler: function(){
    				win2.show()
    			}
    		}]
        });
        
        var win2 = Ext.create('widget.window', {
            height: 200,
            width: 200,
            title: 'Window 2',
            modal: true,
    		html: 'Content Window 2'
        });
        
        win1.show();
    });
    Note: The fix work if any window have focus, but windows have problem with focus if not clicke after show or an element like textfield in window have focus. I think the key listener have to add to body or somthing like that.

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Looks like a duplicate of this: http://www.sencha.com/forum/showthread.php?145790

    I've added a patch and when I use your test case the second window gets closed as you'd expect. Fix should be in 4.0.7.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #6
    Ext JS Premium Member
    Join Date
    Nov 2008
    Location
    Dsseldorf, Germany
    Posts
    40

    Exclamation

    I think that do not fix my problem.
    My problem is not that esc do not work.
    My problem is that after open second window (via button) and press esc key the first window close.

    Problem still not fix or I am stupid today.

  7. #7
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Right, but the issues are related, I tried your test case with the latest source (after 4.0.6) and it works as expected, so it will be fixed in the next release.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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