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
When initialising finder using an async function rather than static array, the "go-to" event does not work.
The following error is seen in the console:
TypeError: n.find is not a function at Function.finder.selectPath (vendor/finder.min.js)
This is because finder.selectPath is passed the original "data" and expects this to be an array, calling data.find to get the path. However, in this case data is a function and the above error occurs.
I know that go-to may not be possible to find a path which hasn't been retrieved by the async function (and defaultPath wouldn't work at all for the same reason). However, in my case I am emitting go-to to navigate to a path that I know is in the data that already exists in the tree.
What I really want to do is automatically select the top-level child if there is only a single top-level child after building the tree in the async function. Is there a way to do this?
Thanks,
Giles
The text was updated successfully, but these errors were encountered:
Sorry for the delay in response. Have you solved this?
Potentially the library could be tweaked to work in async mode if the data has loaded, but perhaps the most flexible approach would be to listen to the right event and then select the item if there is only one (e.g. column-created maybe? I have to look at the code to see if we have an appropriate event).
I'm not sure if the above is possible with the lib as-is, but in theory doesn't sound too bad to add the functionality.
When initialising finder using an async function rather than static array, the "go-to" event does not work.
The following error is seen in the console:
This is because finder.selectPath is passed the original "data" and expects this to be an array, calling data.find to get the path. However, in this case data is a function and the above error occurs.
I know that go-to may not be possible to find a path which hasn't been retrieved by the async function (and defaultPath wouldn't work at all for the same reason). However, in my case I am emitting go-to to navigate to a path that I know is in the data that already exists in the tree.
What I really want to do is automatically select the top-level child if there is only a single top-level child after building the tree in the async function. Is there a way to do this?
Thanks,
Giles
The text was updated successfully, but these errors were encountered: