JavaScript error with Bootstrap 5 #2361
-
Hello, I upgrade some of my web applications to Bootstrap 5 (even if it is still on beta). I have the following JavaScript error: Here is a simple code to reproduce (based on https://getdatepicker.com/5-4/Usage/): <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="node_modules/tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control datetimepicker-input" id="datetimepicker5" data-toggle="datetimepicker" data-target="#datetimepicker5"/>
</div>
</div>
</div>
<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="node_modules/moment/min/moment-with-locales.js"></script>
<script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
<script>
$(function () {
$('#datetimepicker5').datetimepicker();
});
</script>
</body>
</html>
Thank you for your work on this library ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If I remember correctly, If you have additional questions or need more please fork this stackblitz with your changes. |
Beta Was this translation helpful? Give feedback.
If I remember correctly,
col-*
doesn't have relative positioning, hence the error. I'd either place it in a.form-group
div or supply a div withposition:relative"
v6 is being worked on which won't have a bootstrap dependency or have this requirement, unfortunately it's not ready for general use.If you have additional questions or need more please fork this stackblitz with your changes.