mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
UI – Restore user's current scroll after updating the host software filter (#24455)
## #23095 https://github.com/user-attachments/assets/90640987-e06f-432c-9fd2-765753ac1d73 - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
d47bd8f626
commit
874a1bf495
2 changed files with 8 additions and 0 deletions
1
changes/23095-host-sw-scroll
Normal file
1
changes/23095-host-sw-scroll
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Restore the user's previous scroll, if any, when they change the filter on the host software table.
|
||||
|
|
@ -102,6 +102,13 @@ const HostSoftwareTable = ({
|
|||
routeTemplate,
|
||||
queryParams: newParams,
|
||||
});
|
||||
const prevYScroll = window.scrollY;
|
||||
setTimeout(() => {
|
||||
window.scroll({
|
||||
top: prevYScroll,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, 0);
|
||||
router.replace(nextPath);
|
||||
},
|
||||
[pathPrefix, routeTemplate, router, searchQuery, sortDirection, sortHeader]
|
||||
|
|
|
|||
Loading…
Reference in a new issue