New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No distinction between "click" and "enter" selection in onClick callbacks #208

Closed
bornytm opened this Issue Jun 4, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@bornytm

bornytm commented Jun 4, 2016

When onClick callbacks are called, event.which is equal to 1 even if the item is selected from the dropdown with the enter key.

@running-coder

This comment has been minimized.

Owner

running-coder commented Jun 6, 2016

Right... because the enter key triggers the click event. Do you know if event.which is a readonly property? I haven't investigated yet but indeed could set 13 if possible.

Code reference

@running-coder running-coder added the Bug label Jun 6, 2016

@running-coder running-coder added this to the 2.7.0 milestone Jun 22, 2016

running-coder pushed a commit that referenced this issue Jun 22, 2016

@running-coder

This comment has been minimized.

Owner

running-coder commented Jun 22, 2016

I've added the "enter" event inside e.originalEvent for you to manipulate / distinguish the click event

in your code you can now do something like

callback: {
    onClick: function (node, a, item, event) {
        if (event.originalEvent && event.originalEvent.keyCode === 13) {
            console.log('Enter pressed!')
        }
    }
}

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default

running-coder added a commit that referenced this issue Aug 13, 2016

Version 2.7.0
Features
    #198 Using an async function as a data source
    #195 Add `onCancel` callback

Fixes
    #221 On form reset, input field clears but the value persists
    #211 Global reset styling on inputs has bad effects, keep them local to instantiation
    #208 No distinction between "click" and "enter" selection in onClick callbacks
    #193 Clicking on a suggested option does not select it on IE10/11 Bug
    #184 Invalid encoded characters on dynamic requests for `{{query}}` inside $.Ajax.url

More goodies
    #222 Add JSHint validation
    #215 Fix "main" property in bower.json
    #213 Allow scss customization via !default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment