Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -1904,32 +1904,41 @@ class Browser extends DashboardView {
params={this.props.location?.search}
linkPrefix={'browser/'}
filterClicked={url => {
// Reset to page 1
this.setState({
skip: 0,
});

this.resetPage();
this.props.navigate(generatePath(this.context, url));
}}
removeFilter={filter => {
// Reset to page 1
this.setState({
skip: 0,
});

this.resetPage();
this.removeFilter(filter)
}}
classClicked={() => {
// Reset to page 1
this.setState({
skip: 0,
});
this.resetPage();
}}
categories={allCategories}
/>
);
}

/**
* Resets the page to the first page of results and scrolls to the top.
*/
resetPage() {
// Unselect any currently selected cell and cancel editing action
this.dataBrowserRef.current.setCurrent(null);
this.dataBrowserRef.current.setEditing(false);

// Scroll to top
window.scrollTo({
top: 0,
behavior: 'smooth'
});

// Reset pagination to page 1
this.setState({
skip: 0,
});
}

showNote(message, isError) {
if (!message) {
return;
Expand Down
Loading