@Tony Please consider using a different term instead of "focused tiddler" 
as this is likely to lead to misunderstandings. Focus has a very specific 
meaning in HTML parlance, in brief the element with focus is the target for 
keyboard input.
Details: https://developers.google.com/web/fundamentals/accessibility/focus

What the history list keeps track of is not the same thing, it is the last 
tiddler navigated to via the tm-navigate message. If you have tiddler A 
open in the story and click a link to tiddler B to open it, tiddler B has 
focus and has its name set in $:/HistoryList!!current-tiddler. However, if 
you now click on any part of tiddler A it will receive focus where as the 
history list is not updated. Similarly if you click some part of the side 
bar, it now has focus.

Also note that there have already been discussions around the need for 
extending the TW core to keep track of focus and which tiddler has focus. 
Unconventional use of the term focus will foster confusion.

Lastly, be aware that the history list isn't always updated when a tiddler 
is opened. An example is direct manipulation of the storylist via 
action-setfield or action-listops widgets.

Cheers,
Saq

On Wednesday, July 8, 2020 at 12:38:54 AM UTC+2, TonyM wrote:
>
> Mat,
>
> Much of this here is beyond me, however I read your desire to get a 
> focused tiddler value, however made me wonder if I have something that can 
> help.
>
> The last opened, linked to or edited tiddler (draft of), I call this the 
> "focused tiddler", is stored in $:/HistoryList!!current-tiddler
>
> I am now using this to track the last focused tiddler and scroll to return 
> to that tiddler within a long story.
>
> Regards
> Tony
>
>
> On Wednesday, July 8, 2020 at 5:30:55 AM UTC+10, Mat wrote:
>>
>> Jed, thank you for replying and following this!
>>
>> It is probably possible to pass the name of the current tiddler when the 
>>> tiddler is in edit mode and has focus by using css selectors or by walking 
>>> up the dom tree until you reach a div that has the data-tiddler-title 
>>> attribute.
>>>
>>
>> Sounds hopeful. I have no idea how to pass it using css though. I don't 
>> know if it is relevant but Tobias made this dom plugin 
>> <http://tobibeer.github.io/tw5-plugins/#dom> long ago.
>>  
>>
>>> This should also be possible in text areas outside of edit mode as long 
>>> as they are inside a tiddler, I don't know if it would work in places like 
>>> the sidebar.
>>>
>>
>> Maybe the currentTiddler could be stored in a state tiddler, as set when 
>> focussing on a tiddler?
>>
>> The third item in your list (the popup staying open) is a problem with 
>>> when the values update. At the moment it is only on keyup. That should 
>>> probably be changed to keydown. Making it also update on focus and blur 
>>> events would probably help.
>>>
>>
>> A sufficient simplification, at least for now, might be to limit the 
>> whole mechanism to only work on the text field?
>>  
>>
>>> The last item, being incompatible with the editor toolbar, is because 
>>> when the toolbar is active the editor is put in an iframe. There are limits 
>>> to the information that can be passed in and out of an iframe. We can 
>>> almost certainly work around this but I didn't work on it.
>>>
>>
>> Again, hopeful to hear. Overall, much of the editor toolbar functionality 
>> would actually be better suited inside EditorMagic but it would probably be 
>> a hard sell if it is required. 
>>
>> But, for now, I think the most important thing is the currentTiddler 
>> matter because it prevents the plugin from being used at all outside the 
>> demo. If you have a chance to experiment a bit, it would be terrific!
>>
>> Thanks again!
>>
>> <:-)
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/c2406005-52d3-4ee9-8189-c9d8daf25a53o%40googlegroups.com.

Reply via email to