Skip to content

Shadow DOM elements not identified correctly as contained by a parent element for maintain.disabled #172

Open
@MKhowaja

Description

@MKhowaja

When using ally.maintain.disabled and applying a filter to disable everything on the screen but the elements in the filter, if there are descending elements in the filtered element that are under the shadow DOM, they are not correctly filtered and instead disabled.

This is due to the function call compareDocumentPosition in https://github.com/medialize/ally.js/blob/master/src/util/compare-position.js.

Specifically, the function returns 37 and therefore does not see an element in the shadow DOM as contained.

I created a stackblitz that shows this issue as well as a potential fix to apply in front of the compareDocumentPosition function call

https://stackblitz.com/edit/comparedocumentposition-shadowroot-patch?file=src%2Fapp%2Fapp.component.html

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