Skip to content

How can I catch keydown event?  #51

Description

@loretrisolini

How can I catch keydown event, like .on("keydown", function(){})? I can catch events like select2-open, select-close but I can't catch events like keydown.
The code below works only for close event but It does not work for keydown event.

"<select2 ng-model="fmData.data.value" s2-options="option.value as option.label for option in options"
options="optionsSelect"` id="{{item.id}}-{{fmData.name}}" style="width:100%"></select2>"

            jQuery('#'+ id)
              .on("select2-close",  function(e) {
                console.log("here");
              })
             .on("keydown", function (e) {
               console.log("keydown");
             });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions