D
D
Daria Belova2019-06-02 19:11:46
JavaScript
Daria Belova, 2019-06-02 19:11:46

What is Jquery select2 error when adding new element?

Good evening, tell me, the solution is such an error
Cannot read property 'current' of null
I'm suffering for the second day. Since I'm not very strong in js, I tried to do everything I could. The essence of the problem is this:
in Djnago I use the django-autocomplete-light
library in the admin panel when loading the page, all existing fields work fine, just add a new dynamic element, it gives an error in the console

console error

Uncaught TypeError: Cannot read property 'current' of null
at HTMLSelectElement. (select2.full.js:5205)
at HTMLSelectElement.dispatch (jquery.js:5183)
at HTMLSelectElement.elemData.handle (jquery.js:4991)
at Object.trigger (jquery.js:8249)
at HTMLSelectElement. (jquery.js:8327)
at Function.each (jquery.js:354)
at jQuery.fn.init.each (jquery.js:189)
at jQuery.fn.init.trigger (jquery.js:8326)
at select2.full.js:3081
at AjaxAdapter.SelectAdapter.current (select2.full.js:3048)


5cf3f22ce6995568290128.png

select2.full.js
https://jsfiddle.net/dbelova/f3srwhzt/


I hope very much for your help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question