Conversation
494a077
to
250d4f2
Compare
@@ -74,6 +72,9 @@ export class AutoCompleteCustomElement { | |||
return logger.error('auto complete requires resource or items bindable to be defined'); | |||
} | |||
|
|||
this.search = this.label(this.value); | |||
this.justSelected = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sloppy code style
@@ -131,14 +132,21 @@ export class AutoCompleteCustomElement { | |||
} | |||
|
|||
/** | |||
* returns HTML that wraps matching substrings with strong tags | |||
* returns HTML that wraps matching substrings with strong tags. If not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cut on new sentence or append on the end.
let openDropdown = (show = true) => { | ||
this.showResults = show; | ||
}; | ||
this.dropdownElement = this.element.querySelectorAll('.dropdown.open')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because bootstrap.js will add and remove the open class for you
d994806
to
c5a7862
Compare
if (this.limit) { | ||
query.limit = this.limit; | ||
} | ||
|
||
return query; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove newline
} | ||
|
||
return this.findResults(this.searchQuery(this.search)).then(results => { | ||
let promise = this.findResults(this.searchQuery(this.search)).then(results => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use: this.lastFindPromise = ....
?
It's a sync process as far as I can see, so the assignment is basically the same, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's correct
This enables users to use and array with values to auto-complete on. When using this bindable it disables the performing of requests. Once noticable change is that an empty string will trigger a new search/filter when the input receives focus. Contains the necessary documentation which explains what methods can be overwritten and the newly defined items bindable. Also updated the altered bindables behavior documentation
…instance with replace method
c5a7862
to
aacbcf6
Compare
@VMBindraban and @jeremyvergnas please review. |
} | ||
|
||
this.lastFindPromise = this.findResults(this.searchQuery(this.search)).then(results => { | ||
if (this.lastFindPromise !== promise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed I guess
This enables users to use and array with values to auto-complete on. When using
this bindable it disables the performing of requests.
Contains the necessary documentation which explains what methods can be
overwritten and the newly defined items bindable. Also updated the altered
bindables behavior documentation