Keymap bug in IE

Discuss issues related to v4.x
User avatar
dimehb
Premium Member
Premium Member
Posts: 215
Joined: Fri Oct 02, 2015 11:06 am

Re: Keymap bug in IE

Post by dimehb » Mon Jul 09, 2018 12:01 pm

I'd like to come back on this issue. The following code works on Ext 6.5 but not anymore on the versions after that (tested on 6.5.1, 6.5.2 and 6.5.3):

Code: Select all

this.on('afterrender', function() {                              
            var map = new Ext.KeyMap({
                             target : this.getEl(),
                             binding: [{
                                key: "x",
                                ctrl:true,
                                scope:this,
                                fn: function (keyCode, event) {
                                    alert("Keymap was called!");
                                }
                             }]                             
                         });                                   
         });
Could you verify this?

Note: could be reproduced on scheduler 5.1.14 using the configuration demo.

User avatar
Terence
Core Developer
Core Developer
Posts: 1521
Joined: Tue Apr 01, 2014 2:23 pm

Re: Keymap bug in IE

Post by Terence » Mon Jul 09, 2018 1:23 pm

Hi, yes I verified. I have updated the ticket: https://app.assembla.com/spaces/bryntum ... b=activity

User avatar
Terence
Core Developer
Core Developer
Posts: 1521
Joined: Tue Apr 01, 2014 2:23 pm

Re: Keymap bug in IE

Post by Terence » Tue Jul 17, 2018 10:48 am

This config on the panel will fix the problem.

Code: Select all

horizontalTimeAxisColumnCfg : {
                cellFocusable : true
            },

User avatar
dimehb
Premium Member
Premium Member
Posts: 215
Joined: Fri Oct 02, 2015 11:06 am

Re: Keymap bug in IE

Post by dimehb » Thu May 23, 2019 5:51 pm

Shortcut keys don't seem to do anything in IE11 when I set the target element to the scheduling view:

Code: Select all

const targetEl = this.getSchedulingView().getEl();
new Ext.util.KeyMap({
    target: targetEl,
    key: "x",
    ctrl: true, 
    scope: this,
    handler: this.cutEvent
});
Previously I used this.getEl() but since we have a search bar (that has its own shortcut keys) I had to narrow it down to the scheduling view.

The horizontalTimeAxisColumnCfg config doesn't seem to have an effect.

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 1728
Joined: Fri Apr 01, 2016 11:08 am

Re: Keymap bug in IE

Post by pmiklashevich » Thu May 23, 2019 9:25 pm

Hello,

Please look at Sch.patches.NavigationModel.overrides.onCellClick

Code: Select all

// https://app.assembla.com/spaces/bryntum/tickets/4595
onCellClick: function(view, cell, cellIndex, record, row, recordIndex, clickEvent) {

    this.callParent(arguments);

    if (clickEvent.position.column.cellFocusable === false) {
        if (view.isNormalView) {
            if (Ext.isIE11m) {
                view.ownerCt.el.focus();
            } else {
                if (!this.lastFocused) {
                    view.el.focus();
                }
            }
        }
    }
}
In case of IE11 focus goes to ownerCt.

Code: Select all

Ext.first('schedulerpanel').getSchedulingView() === Ext.first('schedulerpanel').normalGrid.getView();
Ext.first('schedulerpanel').getSchedulingView().ownerCt === Ext.first('schedulerpanel').normalGrid;
// true & true
So in other words in case of IE normal grid receives the focus, not the normal view.

Please try to configure listener as following:

Code: Select all

const targetEl = Ext.isIE11m ? Ext.first('schedulerpanel').normalGrid.getEl() : Ext.first('schedulerpanel').getSchedulingView().getEl();
new Ext.util.KeyMap({
    target: targetEl,
    key: "x",
    ctrl: true,
    scope: console,
    handler: console.log
});
Does it solve your issue?

Cheers,
Pavel
Pavel Miklashevich - Core Developer

Post Reply