Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Question about keyDown and keyPress on SelectItem

$
0
0
Hi,

We have a question regarding to keyDown and keyPress event for SelectItem. We are trying to show picklist of a SelectItem by pressing the "Enter" key when it has focus. However, we notice that if we use the keyPress event, it works. If we use keyDown event, it doesn't work.

Our question is
1. Is this a default behavior or an issue?
2. Since in our product we are only using the keyDown event currently, if we introduce both keyDown and keyPress event for the SelectItem, will it cause any potential problem?

Please try the standalone with following steps:

1. Put focus on "Item Name" field, press enter and the picklist is not shown but option "A" is select.
2. Put focus on "Item Name 2" field, press enter and the picklist is shown as expected.

This behavior can be reproduced on SmartClient v8.3p_2014-10-23 build and SmartClient v9.1p_2014-09-16 build on IE9, Firefox 12 and Chrome.

Thanks,
Robin

Code:

isc.DynamicForm.create({
    ID:"testForm",
    width: 500, 
    fields : [
    {  ID:"testSelect",
        title: "Item Name", editorType: "select",
        valueMap: {"1":"A", "2":"B", "3":"C"},
        keyDown: function(item, form, keyName) { if (keyName == "Enter") {item.showPickList();} return true; }},
    {  ID:"testSelect2",
        title: "Item Name 2", editorType: "select",
        valueMap: {"1":"A", "2":"B", "3":"C"},
        keyPress: function(item, form, keyName) { if (keyName == "Enter") {item.showPickList();} return true; }}]
});


Viewing all articles
Browse latest Browse all 4756

Trending Articles