You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey!
First of all, sorry for using GitHub issues for asking questions but not sure what's the best place to ask for help. I want to ask what's the best way to access targets during the initialization process (according to docs,connectedCallback might be too early to query element from the DOM)? Let's say I'd like to setup / start dropzone on a specific target when component is initialized. When / how should I do it?
Actually I've found html-parsed-element which addresses this problem (it's a nice abstraction over MutationObserver). Unfortunately, it does not allow to override connectedCallback via regular operator assignment (used by @controller decorator), so I've created a PR to fix it. Hopefully it gets merged, so we can access targets in the parsedCallback like this:
PS. TypeScript might complain about HTMLParsedElement compatilbity with HTMLElement (Argument of type 'typeof TextEditorElement' is not assignable to parameter of type 'CustomElement'. Type 'TextEditorElement' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 234 more.).
Activity
lcmen commentedon Mar 27, 2021
Actually I've found html-parsed-element which addresses this problem (it's a nice abstraction over
MutationObserver). Unfortunately, it does not allow to overrideconnectedCallbackvia regular operator assignment (used by@controllerdecorator), so I've created a PR to fix it. Hopefully it gets merged, so we can access targets in theparsedCallbacklike this:PS. TypeScript might complain about
HTMLParsedElementcompatilbity withHTMLElement(Argument of type 'typeof TextEditorElement' is not assignable to parameter of type 'CustomElement'. Type 'TextEditorElement' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 234 more.).lcmen commentedon Mar 27, 2021
PR got merged, and new version has been released so
parsedCallbackcan be used withcatalystto initialize targets as shown above.Should I add such info to the guides?