-
Notifications
You must be signed in to change notification settings - Fork 209
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
fix(action-menu): add a slot for Tooltip content #3488
Conversation
Tachometer resultsChromeaction-menu permalink
Firefoxaction-menu permalink
|
64fd49b
to
e7aa92d
Compare
55a6a17
to
004e735
Compare
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.
I need to discuss with the team available APIs here for uniformity across the project, but if this version is the right one then you'll be on a good path for this merge with these notes.
@@ -52,6 +54,9 @@ export const ActionMenuMarkup = ({ | |||
<sp-menu-divider></sp-menu-divider> | |||
<sp-menu-item>Save Selection</sp-menu-item> | |||
<sp-menu-item disabled>Make Work Path</sp-menu-item> | |||
${tooltip_description | |||
? html`<sp-tooltip slot='tooltip' self-managed placement=${tooltip_placement}>${tooltip_description}</sp-tooltip` |
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.
There's no definition for <sp-tooltip>
included in this file.
There's also a missing >
.
@@ -114,6 +159,14 @@ iconOnly.args = { | |||
visibleLabel: '', | |||
}; | |||
|
|||
export const tooltip_description_placement = ( |
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.
Convert these snake_case variables to camelCase to match the rest of the project.
b4d01a0
to
f92d3dc
Compare
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.
Baring the notes in this review, we think this approach is the correct path forward.
Concerning the issues you experienced with Overlay V2, we see that as a feature that should be added to <sp-tooltip>
in that context, and doesn't need to derail the work you are doing here.
packages/action-menu/README.md
Outdated
|
||
```html | ||
<sp-action-menu | ||
<sp-tooltip slot='tooltip' self-managed placement='bottom'>'Content'</sp-tooltip>` |
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.
<sp-tooltip slot='tooltip' self-managed placement='bottom'>'Content'</sp-tooltip>` | |
<sp-tooltip slot='tooltip' self-managed placement='bottom'>'Content'</sp-tooltip> |
packages/action-menu/README.md
Outdated
Tooltip in action menu can be added via a slot. It can be attached to action menu by adding <sp-action-menu> and giving various parameters (e.g. placement, content, etc) as needed. | ||
|
||
```html | ||
<sp-action-menu |
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.
<sp-action-menu | |
<sp-action-menu> |
@@ -114,6 +159,14 @@ iconOnly.args = { | |||
visibleLabel: '', | |||
}; | |||
|
|||
export const tooltipDescriptionAndPlacement = ( |
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.
Please ship this story without a visible label.
packages/action-menu/README.md
Outdated
|
||
## Adding tootip in action menu | ||
|
||
Tooltip in action menu can be added via a slot. It can be attached to action menu by adding <sp-action-menu> and giving various parameters (e.g. placement, content, etc) as needed. |
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.
This doesn't seem right.
eb1486c
to
bfba140
Compare
@@ -55,6 +56,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') { | |||
<sp-icon-more class="icon"></sp-icon-more> | |||
</slot> | |||
<slot name="label" ?hidden=${!this.hasLabel}></slot> | |||
<slot name="tooltip" ?hidden=${this.open}></slot> |
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.
I do not believe this is necessary. As noted, we'll address the Tooltip functionality in Overlay V2 as part of the Tooltip in that work.
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.
This is temporary fix. Once this issue will be addressed in Tooltip functionality in Overlay V2. Will remove it.
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.
This is not required in the V1 API and leaving it "fixed" will make it harder to include the actual fix in the V2 PR. Please remove.
f3f87d1
to
e4dc019
Compare
971a6f9
to
dfa44f5
Compare
d4684d9
to
5e2cb1d
Compare
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.
The code here looks great!
Can you add back the story that was here a couple of commits back? My comment on it was to make sure that it didn't have a visible label by default, not to remove it. Sorry if I was unclear.
With that back in (and the related VRT updates), we should be good to ship this. Thanks!
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.
Thanks for working through this with us! Looks good to go 🥳
Tooltip for ActionMenu
Description
Related issue(s)
#2916
Motivation and context
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.