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
(We can't just listen for the blur of the topic search input, as this will cause the search results to close when you click inside the search results (e.g. on the follow button).)
So, there's a couple of questions:
What is an acceptable way for an x-dash component to add (and remove) DOM event listeners outside of themselves? (we should avoid it if we can, but in this case it seems unavoidable).
How to pass a ref to a DOM node from the wrapped component to the action? E.g. the event handler has this condition: componentRootNode.contains(event.target)
The text was updated successfully, but these errors were encountered:
So I'll speak for FT.com... I think it's fine to use regular class components, add these listeners when the component is mounted, and remove them when unmounted. I'm sure this is not new advice to you but I guess this is the happy path. #248 indicates this may also be the way forward.
I can't offer any insight as to whether this approach would or would not work in the app.
that approach is fine for the app, but not exposing class components means we have much more control over statically verifying that components aren't doing bad things
In order for x-topic-search's results to be closed when you interact with something else on the page, we need do something like this:
(We can't just listen for the
blur
of the topic search input, as this will cause the search results to close when you click inside the search results (e.g. on the follow button).)So, there's a couple of questions:
componentRootNode.contains(event.target)
The text was updated successfully, but these errors were encountered: