Skip to content

Datepicker & MutationObserveru - infinite loop #6782

@adros

Description

@adros

Bug description:

When there is a MutionObserver, which observers document.body, there is an infinite loop, when opening Datepicker dropdown.
This is cause by positioning of the modal, executed on zone change (caused by MutationObserver), which temporary resets the dropdown position and thich mutates the body.

Adding this (sample) code will cause the infinite loop.

    const observer = new MutationObserver(function (a) {
      console.log('Body mutated');
    }
    );
    observer.observe(document.body, {
      childList: true,
      subtree: true,
      attributes: true,
      characterData: true
    })

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 20

Angular: 20

Bootstrap: 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions