Skip to content

feat(tooltip): Angular slTooltip directive - add support for setting type - #3608

Merged
anna-lach merged 5 commits into
mainfrom
docs/2928-tooltip-its-not-possible-to-set-configuration-options-for-the-tooltip-using-angular-tooltip-directive
Aug 19, 2026
Merged

feat(tooltip): Angular slTooltip directive - add support for setting type#3608
anna-lach merged 5 commits into
mainfrom
docs/2928-tooltip-its-not-possible-to-set-configuration-options-for-the-tooltip-using-angular-tooltip-directive

Conversation

@anna-lach

@anna-lach anna-lach commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This PR adds support for specifying the tooltip type (such as label or description) via the slTooltip directive input in the Angular package. The directive now accepts either a string or an object with text and optional type, improving accessibility and flexibility. The Angular documentation and stories have been updated to reflect the new API and usage patterns.

Angular Tooltip directive improvements:

  • The slTooltip directive now supports an object input { text, type } in addition to a string, allowing tooltips to use different ARIA semantics (label or description).

Angular documentation and story updates:

  • Updated the tooltip documentation and storybook stories to demonstrate the new input format, usage examples, and global styling guidance for tooltips created by the directive.
  • Clarified usage of the for and type attributes for tooltips in overlay stories, aligning with the new directive capabilities.
  • Updated the tooltip usage example in wrappers-overlay.stories.ts to use the for attribute instead of aria-describedby, aligning with the latest recommended approach.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d6468d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sl-design-system/angular Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…-not-possible-to-set-configuration-options-for-the-tooltip-using-angular-tooltip-directive
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@a11ymiko a11ymiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tooltip content is added as aria-labelledby to the button with text. This is not correct because text of button is not being announced by this.

Tooltip content should be added as aria-describedby. and then screen reader would announce both text from the button (as button's label) and tooltip's content (as button's description).

This issue is present in Angular > Components > Tooltip as well as Angular > Wrappers > Tooltip.

Image

@a11ymiko a11ymiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Before tooltip disappears it changes position to display on top of button. This happens only in Safari.
This is similar bug to: #3598

Screen.Recording.2026-08-18.at.08.24.53.mov

@a11ymiko a11ymiko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In Angular tooltip documentation first time slTooltip is mentioned it is styled as code with use. But in 'Directive' section it is styled as normal text:

Image

…ty, add support for type in the slTooltip directive, changeset
@anna-lach

Copy link
Copy Markdown
Collaborator Author

Before tooltip disappears it changes position to display on top of button. This happens only in Safari. This is similar bug to: #3598

Screen.Recording.2026-08-18.at.08.24.53.mov

I think it would be the best to work on it in the #3598 issue.

@anna-lach

Copy link
Copy Markdown
Collaborator Author

Tooltip content is added as aria-labelledby to the button with text. This is not correct because text of button is not being announced by this.

Tooltip content should be added as aria-describedby. and then screen reader would announce both text from the button (as button's label) and tooltip's content (as button's description).

This issue is present in Angular > Components > Tooltip as well as Angular > Wrappers > Tooltip.

Image

Good catch! It should be fine now.

@anna-lach anna-lach changed the title docs(tooltip): Angular documentation - slTooltip directive usage and tooltip examples feat(tooltip): Angular slTooltip directive - add support for setting type Aug 18, 2026
@anna-lach
anna-lach requested a balanced review from Copilot August 18, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable tooltip semantics to Angular’s slTooltip directive and updates related examples and documentation.

Changes:

  • Accepts { text, type } tooltip inputs.
  • Adds styled directive examples and accessibility guidance.
  • Updates generated MDX and overlay usage.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.changeset/sour-eyes-check.md Records the Angular feature.
scripts/extract-story-templates.js Normalizes escaped backticks.
packages/angular/src/tooltip.directive.ts Adds tooltip type support.
packages/angular/stories/tooltip.stories.ts Expands directive examples.
packages/angular/stories/tooltip.intro.md Documents usage and styling.
packages/angular/stories/wrappers-overlay.stories.ts Uses the for association.
packages/angular/stories/generated/tooltip.mdx Updates generated tooltip docs.
packages/angular/stories/generated/wrappers-overlay.mdx Updates generated overlay docs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/angular/src/tooltip.directive.ts
@a11ymiko
a11ymiko marked this pull request as ready for review August 19, 2026 08:08
@anna-lach
anna-lach merged commit 7636569 into main Aug 19, 2026
14 checks passed
@anna-lach
anna-lach deleted the docs/2928-tooltip-its-not-possible-to-set-configuration-options-for-the-tooltip-using-angular-tooltip-directive branch August 19, 2026 09:01
@github-actions github-actions Bot mentioned this pull request Aug 19, 2026
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.

[Tooltip] It's not possible to set configuration options for the tooltip using Angular tooltip directive

4 participants