Skip to content

Commit

Permalink
issue #666: V3: anchor didn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-reis committed Oct 30, 2024
1 parent ac5dc63 commit 6e905ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/ArticleV3/Article.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const Article = ({
console.info('[Article] onCellClickHandler', dataHref)
setSelectedDataHref(dataHref)
}

if (e.target.hasAttribute('data-idx')) {
e.preventDefault();
setSelectedCellIdx(e.target.getAttribute('data-idx'));
}
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArticleV3/ArticleScrollTo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ArticleScrollTo = () => {
}
}
useEffect(() => {
if(selectedCellIdxFromStore !== -1 && selectedCellIdx !== -1 && selectedCellIdxFromStore !== selectedCellIdx) {
if(selectedCellIdxFromStore !== -1 && selectedCellIdxFromStore !== selectedCellIdx) {
moveTo(selectedCellIdxFromStore)
setQuery({ [DisplayLayerCellIdxQueryParam]: selectedCellIdxFromStore })
}
Expand Down

0 comments on commit 6e905ea

Please sign in to comment.