wikilabs / plugins

TW5 plugins: https://wikilabs.github.io
30 stars 8 forks source link

[BUG] Tab (button) content is deleted when advanced search is repeated #135

Closed CodaCodr closed 1 year ago

CodaCodr commented 1 year ago

Describe the bug

I host a copy of the advanced search tabs elsewhere in my wiki.

image

When AS+ is installed, the second copy of AS loses the text from the tab-buttons:

image

The regular AS is unharmed:

image

Expected behavior

No response

To Reproduce

No response

Screenshots

No response

TiddlyWiki Configuration

TW 5.2.5 Firefox latest Win10

Additional context

No response

pmario commented 1 year ago

hmm. How does your Find tab content look like? can you post the code from the Find tab?

CodaCodr commented 1 year ago

If I recall, I just snagged it from TW (quite some time ago).

<div class="tc-advanced-search">
<$macrocall $name="tabs" class="bk-tw-advanced-search"
 tabsList="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]" 
 default="$:/core/ui/AdvancedSearch/System" 
 actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<currentTab>>/>""" 
 />
</div>

I tried it on the demo site, too:

image

Then I tried it live on TW .com - same result.

CodaCodr commented 1 year ago

image

pmario commented 1 year ago

IMO that's the wrong code. If you want the ASP buttons you need to use the button template that comes from the plugin

\whitespace trim
<div class="tc-advanced-search">
    <<tabs tabsList:"[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]" default:"$:/core/ui/AdvancedSearch/System" 
        buttonTemplate:"$:/plugins/wikilabs/advanced-search-plus/TabButtonTemplate" explicitState:"$:/state/tab--1498284803">>
</div>
CodaCodr commented 1 year ago

Got it. Thanks Mario!