Skip to content
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

feat: add support for multiline tooltip content with formatting #1384

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sohonisaurabh
Copy link
Collaborator

@sohonisaurabh sohonisaurabh commented Nov 3, 2022

Description

md-tooltip is designed to accept plain text content. If the content overflows max-width, it flows to the next line. This does not allow us to pre-format text, especially a multi-line one like shown below:

Screenshot 2022-11-04 at 11 17 42 AM

Changes in this PR includes following to support pre-formatted tooltip content:

  1. Replace <div> with <pre> to facilitate rendering of pre-formatted text
  2. Add in CSS classes for <pre> tag to keep the UI same as before
  3. Add in part attributes to popover and content element to facilitate further customizations

Related Issue

NA

Motivation and Context

Got this multiline tooltip UX for one of the use cases in Analyzer UX refresh. To support such requirements in future, it was decided to update the rendering logic of md-tooltip

How Has This Been Tested?

Compared with existing UI. No change observed. Also waiting for results of visual regression tests

Screenshots:

Screenshot 2022-11-03 at 7 43 49 PM

After:
Screenshot 2022-11-03 at 7 43 49 PM
Screenshot 2022-11-04 at 11 27 37 AM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sohonisaurabh sohonisaurabh self-assigned this Nov 3, 2022
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.

1 participant