-
Notifications
You must be signed in to change notification settings - Fork 367
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
base: master
Are you sure you want to change the base?
Item sheet trait tooltip #17685
Conversation
src/util/tags.ts
Outdated
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>`; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No inline HTML
There was a problem hiding this comment.
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.
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. |
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. |
A template would probably be best in this case. |
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:
CONFIG.PF2E.traitsDescriptions