Skip to content

Fix automatic ChildrenTree type filter reset

Erwan Rouchet requested to merge fix-tree-filter-reset into master

Closes #1290 (closed)

When switching to a completely unrelated element, the children tree automatically resets the type filter. The filter gets reset anytime someone navigates away from an element view to a different view, or someone switches to an element that is not a neighbor of that element (for example, a parent, or using the menu of the previous button to go back to other elements). Navigating to something else also happens whenever the query string changes. When an element is clicked in the ChildrenTree, the ?highlight= query parameter is set, triggering a navigation, so this check runs.

In !1527 (merged), a function that helps in detecting whether an element is a neighbor of another got changed. Due to the weirdness of the previous ListElementNeighbors structure, you could find your current element within its neighbors, so the function would, perhaps accidentally, detect that the element is a neighbor of itself. This behavior got fixed, causing the tree to think that the element is not a neighbor of itself and therefore reset the filter.

Merge request reports

Loading