-
Notifications
You must be signed in to change notification settings - Fork 211
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
refactor: update tooltip usage #1673
Conversation
Branch PreviewWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
|
Tachometer resultsaction-bar permalink
action-menu permalink
overlay permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
|
bd6d81f
to
c0c2c65
Compare
793d387
to
404c109
Compare
404c109
to
ab043e9
Compare
ab043e9
to
e985fda
Compare
ed77786
to
0625924
Compare
0625924
to
5e64b35
Compare
fa70b4c
to
72bc047
Compare
packages/tooltip/src/Tooltip.ts
Outdated
|
||
private openOverlay = async (): Promise<void> => { | ||
const parentElement = this.parentElement as HTMLElement; | ||
this.closeOverlayCallback = await openOverlay( |
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.
Just realizing that this PR exhibits the same asynchronous issue that we recently massages out of overlay-trigger
😱 I'll clean this up today so that it matches what we ended up with in that element, which is much nicer!
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 might also have something to do with why overlay-trigger
tooltips and sp-tooltip[auto]
surface content to the screen reader differently. Will review that more closely as well!
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.
Sorry to bikeshed, but is auto
the best description for this inverted tooltip API for a user who isn't necessarily expert at the underlying implementations? I wonder if something like nested
, contained
, or inner
might be more intuitive.
packages/tooltip/src/Tooltip.ts
Outdated
private closeOverlay = (): void => { | ||
if (this.closeOverlayCallback) { | ||
this.closeOverlayCallback(); | ||
delete this.closeOverlayCallback; | ||
} | ||
}; |
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.
We might exit early here to reduce a level of nesting:
private closeOverlay = (): void => { | |
if (this.closeOverlayCallback) { | |
this.closeOverlayCallback(); | |
delete this.closeOverlayCallback; | |
} | |
}; | |
private closeOverlay(): void { | |
if (!this.closeOverlayCallback) return; | |
this.closeOverlayCallback(); | |
delete this.closeOverlayCallback; | |
}; |
f8a846c
to
c178b66
Compare
@hunterloftis I get your request for renaming this attribute, but I'm not sure I can agree to any of the suggested. If In a breaking API change, I might prefer to call this default and the versions that require wrapping |
c178b66
to
88ac612
Compare
@Westbrook I can get behind |
@Westbrook before re-approving I was going to run through a quick manual test. Do we have a new storybook link? https://westbrook-tooltip-alt--spectrum-web-components.netlify.app/storybook/ (from the above bot) loads the docs site. |
dfe86b4
to
16ef0ad
Compare
I went with Once the CI runs through we should get Storybook back 🙈 |
I'm seeing some unexpected behavior in the storybook: self-managed-tooltip-sizing-artifacts.mov |
packages/tooltip/src/tooltip.css
Outdated
@@ -19,6 +19,10 @@ governing permissions and limitations under the License. | |||
border: none; | |||
} | |||
|
|||
:host([auto]:not([aria-hidden])) { |
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.
Look who didn't get updated 👀 😱
16ef0ad
to
2264db8
Compare
2264db8
to
f92e6c9
Compare
Description
Investigate surfacing tooltips via an alternate API.
Related Issue
refs #1436
Motivation and Context
Less DOM is better DOM.
How Has This Been Tested?
Types of changes
Checklist: