inputpicker icon indicating copy to clipboard operation
inputpicker copied to clipboard

JS error "popover is not a function" with most basic example

Open evbrew opened this issue 3 years ago • 3 comments

I must be missing something, I've double-checked i have the same jquery.inputpicker.js file as on the example site https://www.inputpicker.com/

But running this basic example gives an error within the plugin:

<input id="test" value="Text 2" /> <script>$('#test').inputpicker({data:[ "Text 1", "Text 2", "Text 3" ]});</script>

Error in console is: Uncaught TypeError: $(...).popover is not a function at _initPP (file:///D:/Temp/JqueryStuff/inputpicker/src/jquery.inputpicker.js:696:38)

The line in question is: function _initPP(){ $('[data-toggle="popover"]').popover() }

And looking at the js code, the function popover() does seem to be commented out on line 308???

Any help would be much appreciated, thanks.

evbrew avatar Nov 30 '21 17:11 evbrew

Face same error. Please help. I am using Jquery 1.12.4

profangong avatar Dec 11 '21 06:12 profangong

Hi, popover is used in bootstrap. try loading https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js

ukalpa avatar Dec 11 '21 23:12 ukalpa

Hi, @ukalpa I already loaded bootstrap.min.js but still the issue exist + with another issue when choosing an option which is

Uncaught Error: Please use show on visible elements at Fe.show (tooltip.js:220:13) at Fe._enter (tooltip.js:598:15) at Fe.toggle (tooltip.js:191:17) at HTMLDivElement. (tooltip.js:532:107) at HTMLDivElement.i (event-handler.js:102:15)

I fixed the first issue by adding $(document).ready(function () { $('#test').inputpicker({data:[ "Text 1", "Text 2", "Text 3" ]}); });

But now how can I fix the second issue which is Uncaught Error: Please use show on visible elements issue?

FRS4002 avatar Jan 26 '22 09:01 FRS4002