rniemeyer / knockout-jqAutocomplete

knockout-jqAutocomplete is a Knockout.js plugin designed to work with jQuery UI's autocomplete widget.
MIT License
49 stars 20 forks source link

zIndex is not a function #30

Closed BillStrait closed 7 years ago

BillStrait commented 7 years ago

I believe this error started when updating to the latest build of jQuery/jQuery-UI. I've attempted to simplify the page as much as possible using example code to verify the problem is not on my end.

html:

<head>

<script src="/Scripts/jquery-3.1.1.js"></script>

<script src="/Scripts/jquery-ui-1.12.1.js"></script>

</head>

<body>

<input data-bind="jqAuto: { value: myValue, source: myOptions}" />

<script src="/Scripts/knockout-3.4.1.js"></script>

<script src="/Scripts/knockout-jqueryui.min.js"></script>

<script src="/Scripts/knockout-jqAutocomplete.js"></script>

<script src="/Scripts/jqatest.js"></script>

</body>

jqatest.js:

var vm = function (){

    var self = this;

    self.myValue = ko.observable();

    self.myOptions = ["one", "two", "three"];

}
ko.applyBindings(vm);`

error: Uncaught TypeError: Unable to process binding "jqAuto: function (){return { value:myValue,source:myOptions,inputProp:'name',labelProp:'description',valueProp:'id'} }" Message: this.element.zIndex is not a function it hits at knockout-3.4.1.js:72. The knockout-jqAutocomplete.js line that throws is 79.

BillStrait commented 7 years ago

I'm an idiot who forgot to check if autocomplete works without this plugin. It does not. Problem is on my end.

edit: For anyone else who runs into this, or me next time, the problem was Visual Studio removed the old jquery-ui file from the project, but did not remove it from the disk. Bundles caught the old version and attempted to load both on the page.

rniemeyer commented 7 years ago

@BillStrait Thanks for following up!