Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
Pikaday uncought error maximum call stack size exceed

I am trying to use pikaday on dynamically generated input element. However it initiates infinite loop making the page unresponsive. Here is my code

$(document).on('focus', '.slcDate', function(){
    new Pikaday({
        field:this
    })
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Each time you focus an .slcDate input element, You basically initialize a new instance of Pikaday on that element.

It doesn't seem like the plugin itself has any protection for that case and instead it just run into infinite loop. So better make sure that you don't initialize Pikaday plugin more than once on a given element.

Example (by simply adding .initialized class as a flag to filter against):

$(document).on('focus', '.slcDate:not(.initialized)', function(){
    new Pikaday({
        field: this
    });
    $(this).addClass("initialized");
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!