When create a datepicker for a div (non-input) elementm the show/hide functions don't work. ``` <div id="datepicker"></div> <link rel="stylesheet" href="https://code.jquery.com/ui/1.14.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-3.7.1.js"></script> <script src="https://code.jquery.com/ui/1.14.1/jquery-ui.js"></script> <script> $("#datepicker").datepicker(); $("#datepicker").datepicker("hide"); </script> ```
Activity
mgol commentedon Aug 6, 2025
Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?
Also, please provide a runnable test case on a platform like JS Bin.
x3wniu commentedon Aug 21, 2025
Actually my project uses a very old version jQuery UI 1.8.5. I guess this issue exists all the time.
https://jsbin.com/dodahanaxa/edit?html,console,output
mgol commentedon Aug 22, 2025
Thanks for the report. The datepicker module only supports hiding a datepicker that's displayed in an overlay; it depends on only one such instance being present. Therefore, it's incompatible with inline datepickers that may exist in a number of places. I think we should just update the docs at https://github.com/jquery/api.jqueryui.com/blob/62e5ad632267abd0d0ebdc4e9f5b550064fcd05f/entries/datepicker.xml. PRs for that welcome!