KeyTable enables itself when editing a cell twice

KeyTable enables itself when editing a cell twice

mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2
edited August 2018 in Free community support

Hi,
I have keyTable along with inline editing and found something strange. I enter editing in a text cell. The focus is at the end of the text, so I press Shift-Home to select all text, then delete it. I write a new text then press Enter to confirm and exit editing. If I press again Enter to reenter in edit mode, and I press again Shift-Home to select all, it instead moves the focus to the first cell of the table.

So the keyTable seems to bypass the keys disable it just made before.

        editor.on('preOpen', function(e, mode, action ) {
            console.log("preOpen");
            console.log("keys disable");
            dataTable.keys.disable();
        });

I added logs on every enable/disable of keyTable I've done and just before the second Shift-Home, it is disabled.

Here is a live test
http://live.datatables.net/xukuxoyi/2/

Answers

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    I suspect that there is going to be a conflict in the sequence of events here. KeyTable will automatically enable the keys again when close is triggered and I'm wondering if that it happening out of expected sequence here.

    The demo isn't actually running for me as maison.cristalogic.com isn't resolving.

    That said, it might be worth trying the nightly version of KeyTable. It completely revamps how the key enablement works - double click on a cell to trigger editing with the arrow keys navigating the text in the cell. Single click has the arrow keys navigating the table still. This is designed to match Excel's behaviour.

    Allan

  • mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2

    Hi Allan,
    Thank you for this info. I will try this nightly build, but as this is not for production, I may put that on hold until it get released for production.

    Thanks

This discussion has been closed.