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

event onCancel version 2.7.6 #274

Closed
sergefabre opened this Issue Dec 28, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@sergefabre

sergefabre commented Dec 28, 2016

Hello,
When I use version 2.7.1, the callback onCancel work with a click of cancelButton.
With the version 2.7.6, callback onCancel is not trigged...

Can you help Me please ?

@aellis

This comment has been minimized.

aellis commented Jan 4, 2017

I was experiencing this as well and found it was tied to line 653 where it currently says this:

if (scope.rawQuery === "" && scope.query !== "") {

In my testing, rawQuery was "" here but query was as well which caused lines 654 and 655 to not be hit. I believe 2 minor edits resolve this:

  1. Move line 658 before line 653 (I think it is being evaluated before it is being tested here).
  2. Change line 653 to read like so:

if (scope.rawQuery === "" && scope.query === "") {

Unless I am missing something completely - but in my testing this seemed to resolve everything with no newly introduced issues.

@aellis

This comment has been minimized.

aellis commented Jan 4, 2017

One more note - I am still learning my way around GitHub in order to know how to formally submit this the correct way, but if you want to test out the change I forked it to here with the changes:

https://github.com/aellis/jquery-typeahead

@running-coder

This comment has been minimized.

Owner

running-coder commented Jan 4, 2017

Hey, thanks for flagging the issue!

It is indeed caused by a regression introduced by resetInput function clearing the query before triggering the input event. I'll add a test and modify the code to @aellis 's suggestion if it does not impact anything.

running-coder added a commit that referenced this issue Jan 4, 2017

running-coder added a commit that referenced this issue Jan 4, 2017

@running-coder running-coder added this to the 2.8.0 milestone Jan 6, 2017

running-coder added a commit that referenced this issue Mar 1, 2017

Version 2.8.0

Features

- #302 `cache`, `compression` and `ttl` can now be configured at group level
- #299, #304 Add `templateValue` option
- #280 Default suggestions, added suggestion_v1 demo
- #275 Dynamic sources, each groups can now be configured to be `dynamic: true`
- #284 Added option `blurOnTab` to blur Typeahead when "Tab" key is pressed
- #262 Add `onDropdownFilter` callback
- Add `maxLength` option

Fixes

- #297 Duplicated entries in dropdown filters
- #286 Using dynamic, groupOrder and groupTemplate options, the results are empty after the second search
- #285 "undefined" is appearing in the template when a key is not defined instead of empty string
- #283 issue when Ajax `path` config is left blank
- #281 multi level deep data inside the source objects
- #274 onCancel event
- #270 Hide autocomplete suggestions when text input loses focus

running-coder added a commit that referenced this issue Mar 1, 2017

Version 2.8.0
Features
- #302 `cache`, `compression` and `ttl` can now be configured at group level
- #299, #304 Add `templateValue` option
- #280 Default suggestions, added suggestion_v1 demo
- #275 Dynamic sources, each groups can now be configured to be `dynamic: true`
- #284 Added option `blurOnTab` to blur Typeahead when "Tab" key is pressed
- #262 Add `onDropdownFilter` callback
- Add `maxLength` option

Fixes
- #297 Duplicated entries in dropdown filters
- #286 Using dynamic, groupOrder and groupTemplate options, the results are empty after the second search
- #285 "undefined" is appearing in the template when a key is not defined instead of empty string
- #283 issue when Ajax `path` config is left blank
- #281 multi level deep data inside the source objects
- #274 onCancel event
- #270 Hide autocomplete suggestions when text input loses focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment