question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There is an error when destroy a date-picker instance

See original GitHub issue

Detailed description

we have 2 tabs in a page, and one tab has a component which there is a datepicker in it, If we don’t choose the tab contained date-picker, and navigate to another page, there is an error when destroy the date-picker

Describe in detail the issue you’re having.

Is this a feature request (new component, new icon), a bug, or a general issue? component Is this issue related to a specific component? ibm-date-picker What did you expect to happen? What happened instead? What would you like to see changed? when navigate to another page and need to call ngDestroy What browser are you working in? Chrome What version of the Carbon Design System are you using? 3.14.2 What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Steps to reproduce the issue

  1. we have 2 pages, 1st is homepage, 2nd is a tab page which have 2tabs, and Tab2 has a component, which contains a datepicker component.
  2. visit homepage, then visit the tabpage which has tab1 as default,
  3. Click back icon ‘<-’ to return to homepage
  4. The error appears

Additional information

  • Screenshots or code image image

  • Notes this.flatpickrInstance is an Array, when to run this.flatpickrInstance.destroy(); we need to check the length of this.flatpickrInstance

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cal-smithcommented, Aug 14, 2019

Congrats on opening the 700th issue 🎉

Also this.flatpickrInstance isn’t an array, or at least it shouldn’t be. checking !this.flatpickrInstance && !this.flatpickrInstance.destroy should be sufficient. If you’d like to open a PR with the fix that would be amazing.

1reaction
ChenCheresscommented, Aug 15, 2019

Thank you very much for your quickly support!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Destroy method on jQuery DatePicker removes ...
Problem: The problem is that destroying the DatePicker does not seem to destroy the previous selected date value! So when instantiating a new...
Read more >
How to destroy a datepicker in jQuery UI ? - GeeksforGeeks
To destroy a datepicker in jQuery UI, we will be using destroy() method. jQuery UI destroy() method is used to remove the complete...
Read more >
10668 (DatePicker: instActive not released on instance destroy)
It seems that when a datePicker instance is being destryed via _destroyDatePicker, "instActive" which is linked to this instance, is not taken care...
Read more >
How can we remove datepicker.js in Magento 2.4
This is because that file is not added via XML, it is a dependency of other scripts. I can see it is a...
Read more >
Datepicker documentation for JQuery | Mobiscroll
Name Type Default value anchor HTMLElement undefined animation String, Boolean undefined buttons Array
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