gramene-search 2.15.2 → 2.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1345,6 +1345,14 @@ const $af4441dd29af05df$var$handleIdList = (queryObject)=>{
1345
1345
  };
1346
1346
  $af4441dd29af05df$var$grameneFilters.reactGrameneFilters = (0, $gXNCa$reduxbundler.createSelector)('selectQueryObject', 'selectGrameneFilters', 'selectActiveGenomes', 'selectUrlObject', (queryObject, filters, genomes, myUrl)=>{
1347
1347
  if (filters.status === 'init') {
1348
+ // A shared-view link (?view=<hash>) is restored asynchronously by
1349
+ // bootViewFromUrl once the snapshot (and, for private views, the auth
1350
+ // token) has loaded. Do nothing here: clearing filters + running an
1351
+ // unfiltered search would race the restore and leave the restored filter
1352
+ // in the tree but never applied to the search (the stale unfiltered
1353
+ // result stays put). Staying 'init' means the first — and only — search
1354
+ // is the one the snapshot triggers, with the filter in place.
1355
+ if (queryObject.hasOwnProperty('view')) return;
1348
1356
  if (queryObject.filters) {
1349
1357
  const newFilters = JSON.parse(queryObject.filters);
1350
1358
  let actions = [
@@ -20651,14 +20659,31 @@ const $693dd8c7a5607c3a$var$ResultsCmp = (props)=>{
20651
20659
  const divRef = (0, $gXNCa$react.useRef)(null);
20652
20660
  (0, $gXNCa$react.useEffect)(()=>{
20653
20661
  if (v.shouldScroll) {
20654
- // scrollIntoView scrolls whichever ancestor is scrollable — the
20655
- // window on most layouts, or the results pane when the sidebar and
20656
- // results scroll independently (e.g. the sorghumbase app shell).
20657
- // window.scrollTo would be a no-op in that pane-scroll case.
20658
- if (divRef.current) divRef.current.scrollIntoView({
20659
- behavior: 'smooth',
20660
- block: 'start'
20661
- });
20662
+ const el = divRef.current;
20663
+ if (el) {
20664
+ // Scroll ONLY the results' own scroll container to this view. The
20665
+ // sidebar and results scroll independently in the sorghumbase app
20666
+ // shell, and el.scrollIntoView can walk every scrollable ancestor
20667
+ // (nudging the sidebar too), so instead find the results pane and
20668
+ // scroll just that. Fall back to the window when the results
20669
+ // aren't in a dedicated scroll pane (other layouts / mobile).
20670
+ let pane = el.parentElement;
20671
+ while(pane){
20672
+ const oy = window.getComputedStyle(pane).overflowY;
20673
+ if ((oy === 'auto' || oy === 'scroll') && pane.scrollHeight > pane.clientHeight) break;
20674
+ pane = pane.parentElement;
20675
+ }
20676
+ if (pane) {
20677
+ const top = el.getBoundingClientRect().top - pane.getBoundingClientRect().top + pane.scrollTop;
20678
+ pane.scrollTo({
20679
+ top: top,
20680
+ behavior: 'smooth'
20681
+ });
20682
+ } else window.scrollTo({
20683
+ top: el.getBoundingClientRect().top + window.scrollY,
20684
+ behavior: 'smooth'
20685
+ });
20686
+ }
20662
20687
  props.doCancelShouldScroll();
20663
20688
  }
20664
20689
  }, [