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?
Solved! Go to Solution.
Could you please share the code that you implemented to add jQuery to that page?
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:
Previous js file is added by dependency in this file: