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
And debugger shows that for this newly created node the node.match and node.subMatchCount are both undefined. Node should be displayed because I'm filtering a whole branch and the node must be "matching" because it's being added as a child to the displayed node.
I believe that when I'm adding a new node, filter is for some reason not applied which nodeRenderStatus evaluates as "does not match". When I press some key, node is re-rendered and this time filter is applied and therefore is also displayed.
Does another call to this.tree.filterBranches(node => node.data.noteId === 'XXX'); fix it for you?
In this case I would consider to a a tree.updateFilter() method, a a generic helper, that can be called after modifying operations.
Yes, calling this again after .addChildren() seems to fix the issue, I'll use that as a work around for now, thanks for that.
My only concern with this approach (assuming that .updateFilter() will just recalculate everything) is performance. I imagine that applying filter is an expensive operation on large trees, but perhaps it won't be so bad since no changes (except the addition itself) will have to be rendered.
Expected and Actual Behavior
I have active filter:
filter settings is set globally as:
I have fully initialized tree and then later I'm adding a new additional node like this:
Now what happens is this:
So the new node is not visible, however it is added to the DOM:
It's not visible because it has
fancytree-hide
class.Now very interestingly, when I press e.g. arrow down or up (thus changing focused node), this newly created node appears:
the code responsible for setting
fancytree-hide
is in functionnodeRenderStatus
:And debugger shows that for this newly created node the
node.match
andnode.subMatchCount
are bothundefined
. Node should be displayed because I'm filtering a whole branch and the node must be "matching" because it's being added as a child to the displayed node.I believe that when I'm adding a new node, filter is for some reason not applied which
nodeRenderStatus
evaluates as "does not match". When I press some key, node is re-rendered and this time filter is applied and therefore is also displayed.Environment
enabled/affected extensions:
The text was updated successfully, but these errors were encountered: