Cannot read property '_options' of undefined

See original GitHub issue

Hello, For some reason, when there is one simple javascript error (not related with tempusdominus) this script generates one error when clicking in the input field to open the picker (No Icon demo used).

Error : tempusdominus-bootstrap-4.js:2762 Uncaught TypeError: Cannot read property ‘_options’ of undefined at HTMLInputElement.<anonymous> (tempusdominus-bootstrap-4.js:2762) at HTMLDocument.dispatch (jquery.js:5206) at HTMLDocument.elemData.handle (jquery.js:5014) at Object.trigger (jquery.js:8201) at Object.simulate (jquery.js:8260) at HTMLDocument.handler (jquery.js:8319)

HTML :

No Icon (input field only):
<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>

Javascript :

console.log(notAvailableVar);  

$(function () {
  $('#datetimepicker5').datetimepicker();
});

https://jsfiddle.net/seltix/vtfks15z/1/

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:21

github_iconTop GitHub Comments

6reactions
satriaWorkcommented, Nov 19, 2020

try this

<div class="input-group date datepickers" id="ass_date" data-target-input="nearest">
	<label for="assessment_date" class="col-md-4 col-form-label arterix">Assessment Date</label>
	<input id="assessment_date" name="assessment_date" type="text" data-target="#ass_date" data-toggle="datetimepicker" 
         class="form-control col-md-6 datetimepicker-input assessment-date-keypress" data-target="#ass_date" 
         autocomplete="off" required>
</div>

then add this code(JS)

$(.datepickers).datetimepicker({});

hope can help 😃

4reactions
ikarthikngcommented, Feb 20, 2019

Edited the library as suggested by @coltonf93 as shown below to stop getting _options when input was focused without icon. Hopefully, this fix will be included in the main branch soon.

image

Still haven’t found a fix for ‘isSame’ undefined errors when the date is deleted from the input box and datetimepicker is focused again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'options' of undefined
Your problem is that element.config is undefined . You can either go with Basem's anwser ( ...
Read more >
Javascript error "Cannot read property 'options' of undefined"
Problem/Motivation I had this javascript error on a page where entity browser is used (as a dialog) : Uncaught TypeError: Cannot read ...
Read more >
TypeError: Cannot read property 'options' of undefined #599
Expected behavior No exceptions Actual behavior Daily, but fairly low rate of TypeError: Cannot read property 'options' of undefined ...
Read more >
Uncaught type error cannot read property options for undefined
I'm trying to get the selected value of the dropdown in javascript so I can test this value and fill the contents of...
Read more >
Uncaught TypeError: Cannot read property ... - Google Groups
Uncaught TypeError : Cannot read property 'options' of undefined. Seems to be line 87 of the "jquery.fileupload-ui.js" file, which reads:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found