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

Tooltip display and overlap Issue with ix-dropdown component #1618

Open
2 tasks done
pavan6014 opened this issue Dec 14, 2024 · 7 comments
Open
2 tasks done

Tooltip display and overlap Issue with ix-dropdown component #1618

pavan6014 opened this issue Dec 14, 2024 · 7 comments
Labels
type: bug Something isn't working wait for response Wait for author response Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@pavan6014
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

Requirement:
Hover of dropdown items to display different status messages dynamically based on index value.
that is the reason we have used ix-tooltip inside dropdown component.

Description:
There is an issue with the ix-dropdown component where the tooltip is displaying inside the dropdown instead of outside.

Additionally, there is a scrolling issue to the drop down if tooltip content is more and have overlap issues.

Actual Behavior:

  1. The tooltip is displaying inside the dropdown.
  2. There is a scrolling issue where items or tooltips are cut off.

Expected Behavior
The tooltip should display outside the dropdown.
The dropdown should handle scrolling properly without cutting off items or tooltips.

Screenshot:
image

What type of frontend framework are you seeing the problem on?

Angular

Which version of iX do you use?

V2.5.0

Code to produce this issue.

https://stackblitz.com/edit/x35y4ich?file=src%2Fdropdown-icon.ts,src%2Fapp%2Fapp.component.html
 
**HTML code snippet:**
import { Component } from '@angular/core';

@Component({
  selector: 'app-example',
  template: `
    <ix-button id="iconTriggerId">Open</ix-button>
    <ix-dropdown trigger="iconTriggerId">
      <ng-container *ngFor="let status of statusList; let i = index">
        <ix-dropdown-item [id]="'statusTooltip' + i">
          {{ status.value }}
        </ix-dropdown-item>
        <ix-tooltip for="[id='{{ 'statusTooltip' + i }}']" placement="bottom">
          This state change is not valid 
        </ix-tooltip>
      </ng-container>
    </ix-dropdown>
  `,
})
export default class DropdownIcon {
  statusList: Array<{ value: string }> = [
    { value: 'Development' },
    { value: 'Unstable' },
    { value: 'Stable' },
    { value: 'Deprecated' },
  ];
}
@pavan6014 pavan6014 added the triage We discuss this topic in our internal weekly label Dec 14, 2024
@matthiashader
Copy link
Collaborator

Hello @pavan6014, thank you for sharing your insights!
We are actively analyzing the issue and working on a solution. In the meantime, here’s a example with a workaround:
https://stackblitz.com/edit/x35y4ich-twz988tw?file=src%2Fdropdown-icon.ts,src%2Fapp%2Fapp.module.ts

@matthiashader matthiashader added type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Dec 17, 2024
Copy link
Contributor

github-actions bot commented Dec 17, 2024

🤖 Hello @pavan6014

Your issue will be analyzed and is part of our internal workflow.
To get informed about our workflow please checkout the Contributing Guidelines

JIRA: IX-2214

@kathrinschalber
Copy link
Collaborator

Hi @pavan6014, many thanks for your issue.

Could you give a bit more information about what exactly is your use case, including the UX concept behind it? Maybe this will help us understand this requirement better.

Thanks for helping us build and improve iX for everyone 🤗

@matthiashader matthiashader added the wait for response Wait for author response label Dec 17, 2024
@pavan6014
Copy link
Author

Hi @kathrinschalber,

Description:
There is an issue with the ix-dropdown component where the tooltip is displaying inside the dropdown instead of outside.
Additionally, there is a scrolling issue to the drop down if tooltip content is more and have overlap issues.

image

Actual Behavior:

  1. The tooltip is displaying inside the dropdown.
  2. There is a scrolling issue where items or tooltips are cut off.

Expected Behavior

  1. The tooltip should display outside the dropdown.
  2. The dropdown should handle scrolling properly without cutting off items or tooltips.

Example provided in below example>> Hover on drop down item
https://stackblitz.com/edit/x35y4ich?file=src%2Fdropdown-icon.ts,src%2Fapp%2Fapp.component.html

@kathrinschalber
Copy link
Collaborator

Hi @pavan6014! Could you quickly explain why this tooltip is needed from a UX perspective? Usually, we use tooltips only or elements on a base level. Thanks for clarifying!

@pavan6014
Copy link
Author

This is the requirement for UX perspective.
image

image

@kathrinschalber
Copy link
Collaborator

Thank you for providing the UX concept. It gives us a better idea of what you want to achieve and why. 🤗

In general, please keep in mind that disabled elements are non-interactive (see the official W3C for more details on the topic), so a tooltip is not a recommended option. Additionally, disabled elements also cannot be focused, so a tooltip won't be accessible as well.

Here are some alternatives that might fit to your use case:

  1. Hide the invalid options instead of disable them, and if needed, add a heading like "Available state changes" to state that unavailable options are not there
  2. Place disabled elements in a separate section by moving them at the end of the list and add a separator, and add a headline with an explanation like "Currently unavailable state changes"
  3. Add an explanation text at the end of the list explaining why some options are disabled
  4. Add a help button outside the dropdown next to the chip, that shows the tooltip explaining that some options might not be available for some reasons

If there are any further questions, let us know - we are happy to help ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working wait for response Wait for author response Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

No branches or pull requests

3 participants