Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

added option for user to select the length of autocomplete #183

Merged
merged 2 commits into from
May 13, 2019

Conversation

loonix
Copy link
Contributor

@loonix loonix commented May 13, 2019

Hi there,

Just noticed that I missed something on this feature. It is a small change but it detects if the user has used the minLength and applies it to the field. For example if you want the user to be able to clear the input or be able to add a text with less than 3 characters.

image

@codecov-io
Copy link

codecov-io commented May 13, 2019

Codecov Report

Merging #183 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
- Coverage   33.26%   33.25%   -<.01%     
==========================================
  Files         149      149              
  Lines        6294     6295       +1     
  Branches     1909     1910       +1     
==========================================
  Hits         2093     2093              
- Misses       4193     4194       +1     
  Partials        8        8
Impacted Files Coverage Δ
...es/angular-slickgrid/editors/autoCompleteEditor.ts 21.06% <0%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7515189...c56aa53. Read the comment docs.

@@ -160,8 +160,9 @@ export class AutoCompleteEditor implements Editor {

serializeValue() {
// if user provided a custom structure, we will serialize the value returned from the object with custom structure
const minLength = this.editorOptions.minLength || this.editorOptions.minLength === 0 ? this.editorOptions.minLength : 3;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it better to do?

const minLength = typeof this.editorOptions.minLength !== 'undefined' ? this.editorOptions.minLength : 3;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, thanks

@ghiscoding
Copy link
Owner

@loonix
I assume you tested that locally before I merge this?

@loonix
Copy link
Contributor Author

loonix commented May 13, 2019

yep, tested before I send it through

@loonix
Copy link
Contributor Author

loonix commented May 13, 2019

image

@ghiscoding ghiscoding merged commit 7113351 into ghiscoding:master May 13, 2019
@ghiscoding
Copy link
Owner

I see you added Uncyclo as well, thanks for that!

@loonix loonix deleted the autocomplete-minlength branch May 13, 2019 15:19
@loonix
Copy link
Contributor Author

loonix commented May 13, 2019

no problem, happy to help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants