-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contents view: Item selection persists over different locations #5209
Comments
The reason this happens is because of the fact that Solution Proposed.I think the best solution for this is to store the entire information of the items that are selected rather than just storing the ids in Please do help me with any other approaches to this problem. |
Another proposal: In if (
this.state.items !== prevState.items &&
this.state.selected.length > 0
) {
this.setState({
selected: this.state.selected.filter((id) =>
find(this.state.items, { '@id': id }),
),
});
} As soon as the items the component has access to change, we want to update |
That's eventually re-setting selected Items to empty whenever we navigate to a new location right. Since whenever we go to a new location none of the previously selected items are going to be present in the new |
Yes, I think you are right. My proposed code snippet should ensure that in But yes, I think in fact this will always set if (
this.state.items !== prevState.items &&
this.state.selected.length > 0
) {
this.setState({
selected: [],
});
} |
Describe the bug
Selections made in
contents
view persist even if user navigates to different location. This can lead to dangerously unexpected behavior (for example accidentally deleting the wrong items).To Reproduce
Steps to reproduce the behavior:
contents
viewExpected behavior
Only try to delete the currently visible selected items.
Or at least display all titles of items correctly that are going to be deleted.
Screenshots
Software
The text was updated successfully, but these errors were encountered: