-
Notifications
You must be signed in to change notification settings - Fork 7
fix: tooltip rendering #122
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
e6ffee8
692fe33
93aca9b
fb68549
8b5c250
07998ad
ca35475
033d4b3
089bdd3
d232b37
80d7765
2456631
4b4067f
5b7bb53
10f9fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,17 +9,6 @@ export default { | |
| anchor: { control: { type: 'boolean' }, required: false, default: false }, | ||
| default: { control: { type: 'text' }, required: true }, | ||
| }, | ||
| template: ` | ||
| <p> | ||
| The | ||
| <abbr> | ||
| HTML | ||
| <tooltip-box v-bind="args"> | ||
| </tooltip-box> | ||
| </abbr> | ||
| abbr element. | ||
| </p> | ||
| `, | ||
| } | ||
|
|
||
| export const WithAnchor = { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: This story was meant to use the HTML template you removed from default. The "info" icon was expected to appear at the right of "HTML" in the sentence "The HTML abbr element."
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I try to do const Template = (args) => ({
components: { TooltipBox },
setup() {
return { args }
},
template: `
<p>
The <abbr>
HTML
<TooltipBox v-bind="args">{{ args.default }</TooltipBox>
</abbr>
abbr element.
</p>
`,
});
export const WithAnchor = Template.bind({});
WithAnchor.args = {
anchor: true,
default: "Hyper Text Markup Language"
}
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not easy to simulate the behavior of this component with the storybook (render issue).
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me there must be an issue if we have this behavior But we may handle this one in a separated ticket if we don't meet it in our current usages |
||
|
|
@@ -29,8 +18,19 @@ export const WithAnchor = { | |
| } | ||
| } | ||
|
|
||
| export const UseParentOnlyAsAnchor = { | ||
| args: { | ||
| default: "Hyper Text Markup Language" | ||
| const Template = (args) => ({ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. niptick: this template is not an exported story so it could be less confusing to define it before the |
||
| components: { TooltipBox }, | ||
| setup() { | ||
| return { args } | ||
| }, | ||
| template: ` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: The template still doesn't use the expected right HTML exemple It should be: {
template: `
<p>
The
<abbr>
HTML
<tooltip-box v-bind="args">{{ args.default }}</tooltip-box>
</abbr>
abbr element.
</p>`
}The current example is wrong because it doesn't highlight the difference between
|
||
| <p>Mouse hover this text to display the tooltip content.</p> | ||
| <tooltip-box v-bind="args">{{ args.default }}</tooltip-box> | ||
| `, | ||
| }); | ||
|
|
||
| export const UseParentOnlyAsAnchor = Template.bind({}); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. niptick: when we use the right example template without the anchor, there is no visual indication showing the |
||
| UseParentOnlyAsAnchor.args = { | ||
| default: "Hyper Text Markup Languag", | ||
| anchor: false, | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same problem as above ... We got some render issues due to the storybook ...
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I said we may handle it in a separated ticket It is ok in the TagCard but probably because of a specific context
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: it would be nice to add a |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ defineProps({ | |
| }); | ||
|
|
||
| </script> | ||
|
|
||
| <template> | ||
| <div | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to adjust the color a better contrast ratio but I still got this warning (even if i put black and white which meets WCAG AAA standard). I think the issue is coming from the text content which is too short.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you for trying it A solution might be to consider that "i" is an abreviation for "info and then to replace <div class="anchor">i</div>by <abbr title="information" class="anchor">i</abbr>
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still got the same issue (contrast color warning) when using this solution ... |
||
| v-if="anchor" | ||
|
|
@@ -37,11 +38,12 @@ defineProps({ | |
| font-size: smaller; | ||
| float: right; | ||
| margin-left: 5px; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: the "i" in the anchor looks to not be well verticaly aligned in the blue disk, also the text is selectable and as not the right pointer cursor when we mouse the mouse on it
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| margin-top: 5px; | ||
| } | ||
|
|
||
| div[role=tooltip] { | ||
|
|
||
| --_p-inline: 1.5ch; | ||
| --_p-inline: 2.5ch; | ||
| --_p-block: .75ch; | ||
| --_triangle-size: 7px; | ||
| --_shadow-alpha: 50%; | ||
|
|
@@ -62,26 +64,24 @@ div[role=tooltip] { | |
|
|
||
| inline-size: max-content; | ||
|
|
||
| max-inline-size: 25ch; | ||
| max-inline-size: 50ch; | ||
|
|
||
| text-align: start; | ||
|
|
||
| font-size: 1rem; | ||
|
|
||
| font-weight: normal; | ||
| line-height: normal; | ||
| line-height: initial; | ||
|
|
||
| padding: var(--_p-block) var(--_p-inline); | ||
| margin: 0; | ||
|
|
||
| border: 1px solid; | ||
| border-radius: 5px; | ||
|
|
||
| /* Use System Colors https://developer.mozilla.org/en-US/docs/Web/CSS/system-color */ | ||
| color: CanvasText; | ||
| background-color: Canvas; | ||
|
|
||
| border: 1px solid | ||
|
|
||
| } | ||
|
|
||
| /* create a stacking context for elements with tooltips */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,14 +42,9 @@ const projectLink = computed(() => { | |
| <div class="tooltip-calc"> | ||
|
AMorgaut marked this conversation as resolved.
|
||
| how my score is calculated ? | ||
| <tooltip-box> | ||
| <p> | ||
| <strong>{{ labelLong }} </strong><br> | ||
| {{ text }} | ||
| </p> | ||
| <br> | ||
| <p> | ||
| <strong>Identified issues in your app:</strong> | ||
| </p> | ||
| <strong>{{ labelLong }}</strong> | ||
| <br><br> | ||
| <strong>Identified issues in your app:</strong> | ||
| <rule-criticities | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| :minor-severities="minorSeverities" | ||
| :major-severities="majorSeverities" | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: the anchor should be upper than its target text. we can also see on this capture the positionning issue of the "i" in the the blue disc
You can refer to the visual reference there in the TagCard feature request: #91
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this issue fixed?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes the position of the letter 'i' was centered ... |





Uh oh!
There was an error while loading. Please reload this page.