I am trying to observe change in the input value of text input element of the custom-input element at document level in the following document:
<body>
<custom-div>
</custom-div>
</body>
where the Custom Div and Custom Input definitions are as follows:
<!-- custom-div -->
<template>
<custom-input>
</custom-input>
</template>
<!-- custom-input-->
<template>
<input type="text">
<span>Units</span>
</template>
As state here legacy "change" events are not leaked out of shadow root, and the Chromium's test of Mutation Observer on shadow root states "observing from outside shadow DOM should not see mutations in the shadow."
So neither legacy change event with event bubbling, nor Mutation observers with subtree attribute change config would work here. I am curious what was the reason for the second part of the test case?
Also, the only way to implement the above scenario is to set observers on each level of custom elements which set/update their attributes on change of values in their immediate child element?