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

Datepicker - Inline datepicker throws error when using a custom container #1667

Closed
micbenner opened this issue May 19, 2023 · 1 comment · Fixed by #1741
Closed

Datepicker - Inline datepicker throws error when using a custom container #1667

micbenner opened this issue May 19, 2023 · 1 comment · Fixed by #1741
Assignees
Labels
Milestone

Comments

@micbenner
Copy link

When using the datepicker, if you use the inline picker with a customer container option, you will receive the following error:

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Inside the _closeDropdown() method, the code is attempting document.body.removeChild(datepicker) on the body element. Since the container option has changed the parent element (the parent is no longer body) this method throws an error.

https://github.com/mdbootstrap/Tailwind-Elements/blob/dafbb6906a2829a32a9267df082fabb94baca992/src/js/forms/datepicker/index.js#L1114-L1135

To Reproduce

  1. Create a new Datepicker
  2. Set the container option to something other than the body
  3. Set inline: true
@juujisai juujisai added the bug label Jun 5, 2023
@juujisai juujisai added this to the v1.0.0-beta3 milestone Jun 5, 2023
@juujisai
Copy link
Contributor

juujisai commented Jun 5, 2023

Hi! Thanks for letting us know! I have added this issue to our project list so we can fix it. Best Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants