Sorry I didn’t respond sooner, but I have been somewhat distracted for the past few weeks due to a death in my family (my Father passed on March 15, at the ripe old age of 95), and I must have missed this discussion.
The scrolling problem is indeed a side-effect of my “topbar” CSS.
It’s actually quite a subtle problem that originates with how the TWCore invokes the “scrollIntoView()” javascript function.
By default, the TWCore assumes that the element that needs to scroll when the Story River “overflows” is the document.body
, which is a valid assumption only if the .tc-page-container
element (which contains the .tc-story-river
element) grows taller than the current window height.
But my “topbar” CSS changes this by limiting the .tc-page-container
and .tc-story-river
heights to 100vh
, and then setting the .tc-story-river
to overflow:auto; overflow:overlay;
. As a result, it is the Story River element itself which needs to be the target of the scrollIntoView()
javascript call, rather than the document.body
element that the TWCore assumes.
Fortunately, I’ve already worked out an easy fix. Install these two tiddlers:
TiddlyTools/Templates/ScrollHere and TiddlyTools/Widgets/scrollhere.js
-
TiddlyTools/Templates/ScrollHere adds the following line to the end of each tiddler rendered in the Story River:
<$list filter="[{$:/HistoryList!!current-tiddler}match<currentTiddler>]"><$scrollhere/></$list>
-
TiddlyTools/Widgets/scrollhere.js defines the $scrollhere
widget, which invokes the scrollIntoViewIfNeeded()
or scrollIntoView()
javascript function on the current tiddler’s parent container (which is the .tc-story-river
). The result is that when navigating to a tiddler (which updates the $:/HistoryList!!current-tiddler
), the tiddler is once again properly scrolled into view within the Story River.
enjoy,
-e