On Wednesday, November 1, 2017 at 4:04:13 PM UTC+1, Mark S. wrote:
>
> That's a very nice explanation, Mario.
>

thx.
 

> But it begs the question: Why is a 'line feed' rendered as a DOM object 
> (div even?) and not just wrapped up in either the next or prior element?
>

IMO it's a rare bug. ... But as I did discover it the first time, I wasn't 
able track it down. ... As I had a closer look at this thread, I could 
remember, that I've probably seen this problem already. ... 

A line-feed isn't rendered as a DOM element, an that's the problem. If it 
would be one, it would be possible to scroll to it. 

The whole truth here is, that the tm-xx messages bubble up the widget tree 
and not the DOM elements. BUT at the end, the DOM elements are used to 
calculate the real sizes of the different tiddler wrappers. Those sizes are 
used to calculate the scroll positions. 

The wrapper for a tiddler is the "div" that is tagged tc-tiddler-frame, 
which is defined in the $:/core/ui/ViewTemplate. But the actual handling is 
done in the "storyview" which is part of the second list-widget in 
$:/core/ui/PageTemplate/story tiddler. 

So the TW navigate to is only designed to scroll to tiddlers ... And not to 
scroll to elements inside of tiddlers. 

---- low level warning.

Also as I did post above. There is this line 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/storyviews/classic.js#L30
 
of code, which stops the event bubbling in the widget tree. Which imo 
shouldn't be done. ... imo a bug.

About the scroll mechanism -- does it actually send out a series of scroll 
> commands in order to line up the tiddler?
>

Yes. here: 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/utils/dom/scroller.js#L56
 
It's done with window.requestAnimationFrame()
 

> Does it use any of the old HTML technology?
>

Yes. see scroller.js .. That's all HTML hi-tech ;)
 

> I ask because the sidebar links seem to be usuing <a href=*> .
>

Yes, ... and it also adds additional event handlers that catch the click 
(and some other) events. see: 
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/link.js#L123
 
... If you follow the handleClickEvent function in the link.js file, you'll 
see where it starts and how it is "dispatched" line 143 this.dispatchEvent({ 
and where it stopped propagating. line 159 event.stopPropagation()

have fun!
mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f2b24548-9035-40f8-88e1-87762292400a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to