Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

box is undefined #525

Open
rashidmkhan7387 opened this issue Sep 13, 2023 · 4 comments
Open

box is undefined #525

rashidmkhan7387 opened this issue Sep 13, 2023 · 4 comments
Labels
Status: needs submitter response There's additional information to properly assess this issue.

Comments

@rashidmkhan7387
Copy link

Hi All,

Not sure if anybody encountered this issue, i am getting box is undefined error when click on the input box.
Been 3 days or more on investigating this.

@monovertex
Copy link
Collaborator

monovertex commented Jun 4, 2024

Can you please provide a reproduction (JS Fiddle or something similar)?

@monovertex monovertex added the Status: needs submitter response There's additional information to properly assess this issue. label Jun 4, 2024
@VNIIZHT-KODUPP
Copy link

Got same error after few steps:

Init calendar in document.ready:
$('#cal_1').dateRangePicker({});

Then click button, that has function of changing calendar

$('#cal_1').dateRangePicker({
separator: ' - ',
startOfWeek: 'monday',
startDate: '2000-01-01',
format: 'D MMMM YYYY',
autoClose: true,
showWeekNumbers: false,
monthSelect: true,
yearSelect: true,
singleDate: true,
singleMonth: true,
showShortcuts: false});

And if i click on input field before entering function of changing calendar, dates window shows, all ok, and after this all is working after change calendar with function.
But if im not click on input field before change calendar - box is undef error appears....

@VNIIZHT-KODUPP
Copy link

Have some investigation of the problem, have some results.
After changing calendar without opening it single time,

function init_datepicker() {
................
if ($(this).data('date-picker-opened')) {
// here it is always true and init havent done, so we got variable box is really undefined
closeDatePicker();
return;
}
$(this).data('date-picker-opened', true);
.......................

so solution is add
$(this).data('date-picker-opened', false);
before if-then, or remove if at all.

@monovertex
Copy link
Collaborator

Can you provide a JSFiddle with this scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: needs submitter response There's additional information to properly assess this issue.
Projects
None yet
Development

No branches or pull requests

3 participants