Skip to content

autocomplete on select not working after selecting 1st element in electron js #322

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

Closed
sourabh635 opened this issue Apr 11, 2018 · 1 comment

Comments

@sourabh635
Copy link

$('#data').autocomplete({ source: ["sample Data 1", "sample data 2", "sample data 3"], minLength: 3, select: function(event, ui) { $('#data_id').val(ui.item.id); event.preventDefault(); }, focus: function(event, ui) { event.preventDefault(); $(this).val(ui.item.label); }, change: function(event,ui) { // Disallow text except from array list if (!ui.item) { $(this).val(''); $('#data_id').val(''); $(this).focus(); } }, });

after selecting the result form the first search when i tried to select item for next time (it occurs for each) i was unable to do that. I was testing it in electron js.

@sourabh635
Copy link
Author

by placing this line of code in mousedown i was able to fix the issue
if ( this.menu.active ) { this.menu.select( event ); }

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

No branches or pull requests

1 participant