cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 autocomplete

SOLVED

Magento 2 autocomplete

How can I add jQuery autocomplete to checkout custom block? I have already created custom block to checkout page. But when I tried to add jQuery autocomplete to it, I got next error: 

 

jquery-ui.js:7080 Uncaught TypeError: Cannot read property 'element' of undefined
at $.(anonymous function).(anonymous function)._close (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:7080:17)
at $.(anonymous function).(anonymous function)._close (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:402:25)
at $.(anonymous function).(anonymous function).close (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:7076:8)
at $.(anonymous function).(anonymous function).close (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:402:25)
at $.(anonymous function).(anonymous function).blur (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:6813:10)
at HTMLInputElement.handlerProxy (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery/jquery-ui.js:703:7)
at HTMLInputElement.dispatch (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery.js:4624:9)
at HTMLInputElement.elemData.handle (https://127.0.0.1:8446/pub/static/frontend/Magento/luma/et_EE/jquery.js:4292:28)

Can anyone please help me figure out how to add jQuery autocomplete to checkout page custom block any examples or free modules that might use autocomplete field in custom block?

 

Can i use Magento 2 QuickSearch widget in checkout page custom block autocomplete input field? Can provide a code sample (how to use it in module)? I have managed to include it to my js file, but i can not figure out how to provide the data what the widget should use for autocomplete?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 autocomplete

4 REPLIES 4

Re: Magento 2 autocomplete

Hi @Beginner234,



Could you please share the code that you implemented to add jQuery to that page?



Best regards.

Gabriel

Welcome to the Magento Forums. Remember to introduce yourself and read the Magento Forums Guidelines.

Re: Magento 2 autocomplete

The code of the whole module i am currently trying to develop is located in this address (url) 

Re: Magento 2 autocomplete

Sorry for adding the whole module code, but it would be difficult for me to explain it precisely how i added the jQuery to my Module.  To narrow it down the code causing those errors is located in this file:

 

view/frontend/web/js/view/processShippingMethod.js

Previous js file is added by dependency in this file:

/view/frontend/web/js/select-shipping-method-mixin.js

 

 

Re: Magento 2 autocomplete

Solution to problem: KnockoutJs debug and Chrome devtools