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

Item sheet trait tooltip #17685

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Kulkodar
Copy link

@Kulkodar Kulkodar commented Dec 11, 2024

Adjusted createTagifyTraits to include the tag description and adjusted the tag template to remove the browser tool tip from tags. Side effect tags in creature sheets also show their tootip.
Closes #17491

2024-12-11.18-13-55.mp4

TODO:

  • cleanup code
  • test with tags not defined in CONFIG.PF2E.traitsDescriptions
  • hide browser tool tip

@Kulkodar Kulkodar marked this pull request as ready for review December 12, 2024 12:27
src/util/tags.ts Outdated
Comment on lines 72 to 83
return `<tag
contenteditable='false'
spellcheck='false'
tabIndex="${this.settings.a11y.focusableTags ? 0 : -1}"
class="${this.settings.classNames.tag}"
${this.getAttributes(tagData)}>
<x title='' class="${this.settings.classNames.tagX}" role='button' aria-label='remove tag'></x>
<div>
<span class="${this.settings.classNames.tagText}">${tagData[this.settings.tagTextProp] || tagData.value}</span>
</div>
</tag>`;
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No inline HTML

Copy link
Author

@Kulkodar Kulkodar Dec 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stwlam i might need help since i'm not that familiar with type script.
As far as i can see i cant use renderTemplate since an async function can't be assigned to tag: string.
I could use createElements, but then i have to either extend the function to allow custom tags and attributes or change the custom tags to html compliant tags and adjust the styling.

@Kulkodar
Copy link
Author

i moved the html snipped into a getter function, i'm not sure if you meant that or that i should move it into a file.

@Kulkodar Kulkodar requested a review from stwlam December 15, 2024 10:03
@CarlosFdez
Copy link
Collaborator

CarlosFdez commented Dec 15, 2024

I assume stwlam means to use the dom functions to create elements. There's utility methods in src/util/dom.ts to reduce how verbose they are and make it play better with typescript as well.

@stwlam
Copy link
Collaborator

stwlam commented Dec 15, 2024

A template would probably be best in this case.

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

Successfully merging this pull request may close these issues.

Feature Request: Hover over trait tags on item sheets to show description tooltip
3 participants