Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Docs about how to use tag-picker missing #8081

Closed
linonetwo opened this issue Mar 17, 2024 · 5 comments
Closed

[BUG] Docs about how to use tag-picker missing #8081

linonetwo opened this issue Mar 17, 2024 · 5 comments

Comments

@linonetwo
Copy link
Contributor

linonetwo commented Mar 17, 2024

Describe the bug

Tag picker is frequently used by plugin authors, but it don't have a doc about how to use it. https://tiddlywiki.com/#tag-picker%20Macro:%5B%5Btag-picker%20Macro%5D%5D%20%5B%5Btag-picker%20Macro%20(Examples)%5D%5D

And using two tag-picker in same tiddler, will cause they open the dropdown together. I think it might be caused by

<div class="tc-block-dropdown-wrapper">
  <$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">

There might be workaround or a correct usage, I will update the doc once I know it.

Expected behavior

I know half of how to use it:

  <$let tagField="list" newTagNameTiddler=<<qualify "$:/temp/NewTagName">>  currentTiddler=<<draft-tiddler>> saveTiddler=<<draft-tiddler>> currentTiddler=<<draft-tiddler>>>
    {{||$:/core/ui/EditTemplate/tags}}
  </$let>

  <$let tagField="tags" newTagNameTiddler=<<qualify "$:/temp/NewTagName">> currentTiddler=<<draft-tiddler>> saveTiddler=<<draft-tiddler>> currentTiddler=<<draft-tiddler>>>
    {{||$:/core/ui/EditTemplate/tags}}
  </$let>

Need to define many variables like newTagNameTiddler to ensure they don't conflict. (If without newTagNameTiddler, they all edit the first one's field, list in this case.)

But even so, when we have two tag picker like this, they will open the dropdown together.

To Reproduce

  1. Copy the code above to tw5-com create a new tiddler
  2. click on second tag picker's input
  3. you will see two open the dropdown together.

Screenshots

图片

TiddlyWiki Configuration

  • Version 5.3.3

Additional context

I'm using two tag pickers in a modal to create new tiddler in https://github.com/tiddly-gittly/tiddlywiki-calendar/blob/807725b49199409a19a1aa8077e9115612742f51/src/visualization-dashboard/tiddlywiki-ui/Modal/CreateGaugeModal.tid

@linonetwo
Copy link
Contributor Author

linonetwo commented Mar 17, 2024

@BurningTreeC you added this in https://github.com/Jermolene/TiddlyWiki5/pull/4104/files , do you know what's missing in my snippet?

@linonetwo
Copy link
Contributor Author

Wait, why this works fine

图片


They use different currentTiddler, but if you try to edit same currentTiddler 's two different fields, there is bug.

linonetwo added a commit to tiddly-gittly/tiddlywiki-calendar that referenced this issue Mar 17, 2024
@pmario
Copy link
Member

pmario commented Mar 17, 2024

See pending PR: Tag picker rewritten using new v5.3.x syntax #7978

@linonetwo
Copy link
Contributor Author

linonetwo commented Mar 17, 2024

Thanks @pmario , this does not reproduce in your fixed version. And you also include the doc.

@linonetwo
Copy link
Contributor Author

Close this as this is tracking in #7978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants