Wicket
  1. Wicket
  2. WICKET-4998

AjaxFormComponentUpdatingBehavior("onkeypress") is triggered when Enter is used on autocomplete list

    Details

      Description

      Given a text field that uses the following behaviors:
      A. AjaxFormComponentUpdatingBehavior("onkeypress")
      B. AutoCompleteBehavior

      Say I enter an letter 'U' into the text field, and an auto-suggest list pops up.
      When I select an item (e.g. USD) from the auto-suggest list using the Enter keypress, an onkeypress event is fired by behavior A.

      To rectify this problem which didn't happen in wicket 1.4x, I changed the following in wicket-autocomplete.js,

      Wicket.Event.add(obj,"keypress",function(jqEvent){
      if(Wicket.Event.keyCode(jqEvent)===KEY_ENTER){
      if(selected>-1||hidingAutocomplete===1){
      hidingAutocomplete=0;
      jqEvent.stopImmediatePropagation(); <------changed from jqEvent.stopPropagation();

        Issue Links

          Activity

          james yong created issue -
          Sven Meier made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Sven Meier [ svenmeier ]
          Fix Version/s 6.6.0 [ 12323963 ]
          Resolution Fixed [ 1 ]
          Sven Meier made changes -
          Link This issue is related to WICKET-4857 [ WICKET-4857 ]
          Sven Meier made changes -
          Link This issue relates to WICKET-5055 [ WICKET-5055 ]
          Andrea Del Bene made changes -
          Link This issue relates to WICKET-5609 [ WICKET-5609 ]

            People

            • Assignee:
              Sven Meier
              Reporter:
              james yong
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development