Skip to content

Commit 94627b9

Browse files
committed
Remove redundant postUpdateActiveAnchor call
1 parent bca418c commit 94627b9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

streamlit_scroll_navigation/frontend/public/CrossOriginInterface.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class CrossOriginInterface {
3737
console.debug('Updated config', styles, disable_scroll);
3838
}
3939

40+
//Scroll to the anchor with the provided anchorId and call updateActiveAnchor
4041
scroll(anchorId) {
4142
const element = document.getElementById(anchorId);
4243
console.debug('Scrolling to', anchorId);

streamlit_scroll_navigation/frontend/src/ScrollNavigationBar.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ class ScrollNavigationBar extends StreamlitComponentBase<State> {
6666
// Update active anchor for component and COI
6767
this.setState({ activeAnchorId: anchorId });
6868

69-
// Scroll to anchor with COI
69+
// Scroll to anchor with COI and update COI's active anchor
7070
this.postScroll(anchorId);
71-
this.postUpdateActiveAnchor(anchorId);
72-
7371

7472
//Send component value to Streamlit
7573
Streamlit.setComponentValue(anchorId);

0 commit comments

Comments
 (0)