-
Notifications
You must be signed in to change notification settings - Fork 64
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
Added a "display_on_attach" option. #75
base: dev
Are you sure you want to change the base?
Conversation
This allows you to set true or false. If true it will show all available unfiltered items. If false it will not show any item until you start typing (like original).
Hey @dc-m, Thanks for the PR! The diff is very hard to read (is it possible you formated the entire file?). I left some comments but I might have missed some changes as all the file is marked as changed. If you could push an update that will highlight only the changes you made it will be much easier for me to review. |
Sure I will do that when i get back from work tonight - sorry i CTRL + K + D and it must have caused a whole file reshift! |
|
||
value_watch = $scope.$watch( | ||
function () { | ||
if (current_options.display_on_attach && ngmodel.$modelValue == null) ngmodel.$modelValue = ""; |
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.
Change
$scope.selected_index = 0; | ||
$scope.waiting_for_suggestion = true; | ||
|
||
if (typeof(term) === 'string' && term.length > 0 || current_options.display_on_attach) { |
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.
change
Apologies for the way I've done this. I attempted to get it to only show my changes but each time I did it seems to just remove all the original and add all my file. So have commented where I have made changes |
bind_element(); | ||
|
||
//Added to ensure on attach if value there it doesnt try reset to all - DAVID 08/06/2017 | ||
if (current_element[0].value.length == 0) suggest("", current_element);; |
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.
Change
Hey David, A more general approach would be "suggest_when_empty" option. This way you we can also address the situation where the user deleted all the text from the input and you want to trigger a suggest cycle to show some options. If you set
|
This allows you to set true or false. If true it will show all available unfiltered items. If false it will not show any item until you start typing (like original).