yew-hooks
yew-hooks copied to clipboard
Allow using multiple nodes with use_click_away
I am implementing a component consisting of two part: a toggle and some content. The content is shows using a portal.
I do want to use use_click_away, but actually both elements (the toggle and the portal content) should be considered "inside". This works when not using portals by wrapping with an additional element. However, this strategy fails when using portals.
If use_click_away would accept an array of nodes instead, I would be able to define two (or more) nodes as "inside" and it would work.
Let me know if you want me to work on a PR for this.
I didn't test for portal usage, I will take a look for portal since portal is common for model dialogs etc.