I think I may have spotted where the issue may be arising.
This is how the actions are invoked by the droppable widget:
this.invokeActionString(this.droppableActions,this,event,{actionTiddler:
title, modifier: modifierKey})
In contrast, the draggable widget calls
$:/core/modules/utils/dom/dragndrop.js which invokes startActions like this:
options.widget.invokeActionString(startActions,options.widget,event,{
actionTiddler: titleString});
The titleString variable is:
var titleString = $tw.utils.stringifyList(titles);
So the droppable widget is passing one title and the draggable widget is
passing a list of titles.
In the course of making that list, $tw.utils.stringifyList (in
$:/boot/boot.js), does this:
if(entry.indexOf(" ") !== -1) { result.push("[[" + entry + "]]"); } else {
result.push(entry); }
So if there is whitespace, as in the case of [[Missing Tiddler]], it gets
an extra set of brackets in the draggable widget versus the droppable
widget.
On Thursday, January 17, 2019 at 9:13:36 PM UTC, admls wrote:
>
> Hi Mark,
>
> I created an issue on github. I've tried wikifying the list items in
> various ways but I'm not having any luck making a workaround.
>
> Best wishes,
> Adam
>
> On Thursday, January 17, 2019 at 7:12:36 PM UTC, Mark S. wrote:
>>
>> I'm thinking it may be an actual bug. The actionTiddler works as expected
>> inside of droppable, as mentioned before.
>>
>> By changing your case to use filter instead of subfilter, you can see
>> what the macro sees. When I run it this way, I get
>>
>> [[[[Missing Link]]]]
>>
>> I think it's seeing the entire passed text as the literal string
>> "[[[[Missing Link]]]]" If you add "[[[[Missing Link]]]]" to your list, then
>> dragging [[Missing List]] will cause [[[[Missing Link]]]] to disappear.
>>
>> If that's not a bug, I'd like to know the incantation that would make it
>> work ;-)
>>
>> -- Mark
>>
>> On Thursday, January 17, 2019 at 9:46:56 AM UTC-8, AdamS wrote:
>>>
>>> Hi Mark,
>>>
>>> I've tried to get the simplest setup that still features the weird
>>> behavior. It is using the draggable widget.
>>>
>>> \define startactions()
>>> <$action-listops $tiddler="List 1" $subfilter="-[<actionTiddler>]"/>
>>> \end
>>>
>>> <$list filter="[list[List 1]]">
>>> <$draggable tiddler=<<currentTiddler>> startactions=<<startactions>>>
>>> <$text text=<<currentTiddler>>/>
>>> </$draggable>
>>> </$list>
>>>
>>>
>>> And List 1 consists of "[[Link Tiddler]] [[Missing Link]] FakeTid
>>> [[FakeTiddler]]".
>>> FakeTid and [[FakeTiddler]] get removed. The others do not.
>>> Any ideas?
>>>
>>> Best wishes,
>>> Adam
>>>
>>>
>>> On Thursday, January 17, 2019 at 3:28:18 PM UTC, Mark S. wrote:
>>>>
>>>> I think we need to know more about your setup. Are you using the macro
>>>> in draggable, or in droppable? When I use it in droppable, it works right
>>>> out of the box, no matter how many spaces are in the title.
>>>>
>>>> Good luck!
>>>> -- Mark
>>>>
>>>> On Thursday, January 17, 2019 at 1:50:25 AM UTC-8, AdamS wrote:
>>>>>
>>>>> Hello all,
>>>>>
>>>>> I've got this action that is supposed to remove a tiddler from a list
>>>>> of tiddler titles:
>>>>>
>>>>> \define startactions()
>>>>> <$action-listops $tiddler="List 1" $subfilter="-[<actionTiddler>]"/>
>>>>> \end
>>>>>
>>>>> However, it doesn't seem to work if the tiddler title appears in the
>>>>> list in this format [[Two Words]]. It works fine with [[OneWord]] and
>>>>> with
>>>>> OneWord, though. Anyone have any idea what I'm doing wrong here?
>>>>>
>>>>> Best wishes,
>>>>> Adam
>>>>>
>>>>
--
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 [email protected].
To post to this group, send email to [email protected].
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/9b7ac87c-3058-4eed-8804-f6d346f40b4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.