LeaVerou / awesomplete

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.
http://leaverou.github.io/awesomplete/
MIT License
6.97k stars 611 forks source link

`container` option doesn't work in minified version only #17183

Open csmabraham opened 5 years ago

csmabraham commented 5 years ago

In v1.1.4 minified, the container option is broken, as you can see in this linked JSBin. Even though the container is specified to be the <body>, Awesomplete wraps the input in a <div>. Upon inspecting the minified source code, we can see that the minifier has inlined the _.CONTAINER(...) method call into the Awesomplete constructor, and therefore, the container callback provided in the options object is never called.

If you remove the .min from the <script> tag, loading in the non-minified version of Awesomplete, the container option works as expected, and we can see that Awesomplete does not wrap the <input> in a <div>, and instead leaves it directly in the <body>.