Skip to content

Changing the 'container' does not remove domObservers from the old container.  #23

Description

@Duder-onomy

For example, if you have the library initialized with the document as the container,
then you change the container to something more specific. It will still observe the document for mutations and when destroy is called, only remove the observers from the container that you changed it too, not the original container.

This test will not pass:

xit('will respect and changed config values', function() {
    mff.start();

    expect(mff.getKnownElements().length).to.equal(document.querySelectorAll('[focusable]').length - document.querySelectorAll('.hidden').length);

    mff
        .configure({ container : '#iContainMoreFocusables'})
        .refresh();

    expect(mff.getKnownElements().length).to.equal(document.querySelectorAll('#iContainMoreFocusables li').length);
});

There should be a test for:

  1. If changing the container after MFF has started, then it should remove the observer from the previous container and add the observer to the current container.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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