Bug or coding error calling custom widgets more than once?

Install the following on TiddlyWiki.com

\widget $simple.popup(text # class:"tc-popup-keep" label:"More...")
   \function popup-tiddler() [addprefix[$:/state/simple.popup/]addsuffix<#>]addsuffix[/]]
<$button popup=<<popup-tiddler>> ><<label>></$button>
<$reveal type="popup" state=<<popup-tiddler>> class=<<class>> >
<div class="tc-drop-down" style.padding="5px" >
<<text>><<#>>
<$slot $name="ts-raw"/>
</div>
\end $simple.popup

<$simple.popup text="more info as text, ie one liners" #=a/>

<$simple.popup text=more #=b>

Body
</$simple.popup>
<!-- <$simple.popup text="more info as text, ie one liners" #=a/> -->

;Needs work to stop using same attributes and ts-raw?

Within the above I have used the same custom widget twice

<$simple.popup text="more info as text, ie one liners" #=a/>
<$simple.popup text=more #=b>

Body
</$simple.popup>
<!-- <$simple.popup text="more info as text, ie one liners" #=a/> -->

If you select the first button you actually get the results of the second button,. parameters and content. Both first and second return the same result.

  • Un comment the third item and every button returns a blend.
  • Comment out the second and the first works correctly.

Both a and b are being shown.

Check your state tiddler is working correctly.

I had, but I looked closer due to your prompting and there was a stray ] in the popup-tiddler function, yes the state.

\function popup-tiddler() [addprefix[$:/state/simple.popup/]addsuffix<#>addsuffix[/]]

Thanks @CodaCoder

Not exactly the best error message :confused:

Oh well, it’s working now.

1 Like