This is a migrated thread and some comments may be shown as answers.

kendoMenu steal's onKeyDown but not up

1 Answer 13 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kay
Top achievements
Rank 1
Kay asked on 12 Feb 2014, 06:12 AM
Hi,

I have a simple app I am testing kendo ui with, I have the following code :

$("#menu").kendoMenu({ select: function (e) {
        return;
    } });

And else where I set up events to the onKeyDown and onKeyUp like as follows :
document.onkeydown = function(event) {
        console.log('keydown');
    }

    document.onkeyup = function(event) {
        console.log('keyup');
    }


And the html for the menu is as follows :
<div id="mainMenu">
        <ul id="menu">
            <li>
                Debugging
                <ul>
                    <li id='cancelAll'>
                        Cancel all operations
                    </li>
                    <li id='cursorMode'>
                        Cursor modes
                        <ul>
                            <li id='cmNone'>None</li>
                            <li id='cmPoint'>Point</li>
                            <li id='cmLine'>Line</li>
                        </ul>
                    </li>
                    <li id='measureMode'>
                        Measure modes
                        <ul>
                            <li id='mmlengths'>Lengths</li>
                            <li id='mmpolylength'>PolyLength</li>
                            <li id='mmarea'>Area</li>
                        </ul>
                    </li>
                    <li id='dimensionMode'>
                        Dimension modes
                        <ul>
                            <li id='dim_count'>Count</li>
                            <li id='dim_length'>Length</li>
                            <li id='dim_area'>Area</li>
                            <li id='dim_object'>Object</li>
                            <li id='dim_none'>None</li>
                        </ul>
                    </li>
                </ul>
            </li>
        </ul>
    </div>

As soon as I select a sub menu option like 'Count' under Dimension modes, the onKeyDown does not trigger anymore, but if I click outside my app to a blank space on the browser and back again, the event starts working again?

Any ideas of what I could be doing wrong, and for completeness the onKeyUp always works ?????

Thank you in advance.

Jason





1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Feb 2014, 04:25 PM
Hi Jason,

When the Menu receives focus, its keyboard navigation is activated. From this moment on, keystrokes, which are recognized by the Menu (arrow keys, Enter, etc) do not bubble outside the Menu, so that they do not trigger their default behavior (e.g. the arrow keys could scroll the page, which would be undesired). However, keystrokes, which are not recognized by the Menu, are not "stolen".

http://demos.telerik.com/kendo-ui/web/menu/navigation.html

Once the Menu is blurred, all keydown events start bubbling again.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Kay
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or