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(aside): add optional tooltip on header #1015

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

nguyenlam123
Copy link
Contributor

@nguyenlam123 nguyenlam123 commented Oct 15, 2021

  • Provide an opt-in tooltip on the header of the aside component.
  • Can be added to the html via data-ts.tooltip property, for example:
<aside data-ts="Aside"
  id="aside-with-tooltip"
  data-ts.title="Aside Title with tooltip"
  data-ts.tooltip="My Tooltip">
  <div data-ts="Panel">
    <p>Aside content.</p>
  </div>
</aside>
  • Can be added programmatically as displayed below
ts.ui.get('#myAside', function(aside) {
  aside.tooltip('tooltip');
});

, provided that the user has previously added an aside component with the id called myAside.

Tooltip appearance can be displayed in the gif below
asideTooltip

if(!search || !using(search)) {
if(title) {
@class = klass('ts-toolbar-title', null, !hasactions);
<li id="${id}-title" @class>
<label>${title}</label>
if(tooltip) {
<label data-ts="Tooltip" data-ts.title="${tooltip}" data-ts.offset="true">${title}</label>
Copy link

@sebastianflorica sebastianflorica Oct 18, 2021

Choose a reason for hiding this comment

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

Maybe consider adding data-ts.position="bottom" for a cleaner look

Copy link
Contributor Author

@nguyenlam123 nguyenlam123 Oct 18, 2021

Choose a reason for hiding this comment

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

Not sure if I understand. The position of the tooltip is based on coordinates (x, y), link to implementation here:

Do you mean to adjust left and top so it aligns to "bottom", documentation for tooltip here: https://ui.tradeshift.com/v12/#components/tooltip/? 🤔

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@nguyenlam123 nguyenlam123 Oct 18, 2021

Choose a reason for hiding this comment

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

Different repo 🤔 ? IIRC, this tooltip https://ui.tradeshift.com/v12/#components/tooltip doesn't support position.

Choose a reason for hiding this comment

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

I didn't think that they were that different, as features

@Kian-Esmaeilpour Kian-Esmaeilpour merged commit 36be8dd into master Oct 26, 2021
@Kian-Esmaeilpour Kian-Esmaeilpour deleted the tooltip-on-aside branch October 26, 2021 08:24
@aleks-elkin aleks-elkin mentioned this pull request Nov 9, 2021
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.

3 participants