I'm building a simple focus trap as an attribute directive. Part of this will check the child elements within the host to make sure they are actually focusable, i.e. looking to see if an element has the disabled attribute. I've written a little function that does that, it lives outside of my directive class
function isDisabled(element: HTMLElement) {
return element.hasAttribute('disabled');
}
The problem is that it always returns false even if I know one of the elements in the form has the disabled attribute. My assumption is that this is happening because this disabled attribute is set with property binding, so the element might not yet have the disabled property at the time isDisabled() has been called/executed. Assuming this is true, what can I do to solve this? I've attempted to use a different lifecycle hooks in order to catch the component at the "right time" but I've had no success so far.
See the following comment for entire Directive code: