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

Bug: Tooltip shown at wrong place #1976

Closed
oldbig opened this issue Jan 13, 2022 · 8 comments
Closed

Bug: Tooltip shown at wrong place #1976

oldbig opened this issue Jan 13, 2022 · 8 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@oldbig
Copy link
Contributor

oldbig commented Jan 13, 2022

if (isOutOfBounds(el)) {

if (isOutOfBounds(el)) {

When moving to the opposite place, if still is out of bounds, it is just displayed at the wrong place. The fixed code should be as follows:
Line 133

        if (modifiers.top) {
        alignTop(el);
        if (isOutOfBounds(el)) {
            alignBottom(el);
             if (isOutOfBounds(el)) {
                    alignTop(el);
             }
        }
    }

Line 153

    else if (modifiers.bottom) {
        alignBottom(el);
        if (isOutOfBounds(el)) {
            alignTop(el);
            if (isOutOfBounds(el)) {
                alignBottom(el);
            }
        }
    }
@tugcekucukoglu
Copy link
Member

Issue is not clear. Do you have a codesandbox or a repo?

@tugcekucukoglu tugcekucukoglu added the Resolution: Invalid Issue or pull request is not valid in the latest version label Jan 13, 2022
@oldbig
Copy link
Contributor Author

oldbig commented Jan 16, 2022

Hi @tugcekucukoglu
I have no codesandbox, it just happens in a internal project, I create the following diagram to describe the scenario:
image

The reason: when the bottom has not enough space to put the tooltip message, it will be adjusted to the opposite position, but when the opposite position also has not enough space, the tooltip should put it at original place.
And all the following have the same problem:

  • v-tooltip.right
  • v-tooltip.top
  • v-tooltip.bottom
  • v-tooltip.left

@oldbig
Copy link
Contributor Author

oldbig commented Jan 16, 2022

@tugcekucukoglu , this is corresponding Pull Request

@tugcekucukoglu
Copy link
Member

@oldbig Without seeing the problem, we couldn't accept the PR. The issue might be related to your project. How can I replicate this issue?

@oldbig
Copy link
Contributor Author

oldbig commented Jan 18, 2022

@tugcekucukoglu I agree with you, I will prepare a demo of codesandbox.

@oldbig
Copy link
Contributor Author

oldbig commented Jan 18, 2022

Hi @tugcekucukoglu
Please check this demo codesandbox

@oldbig
Copy link
Contributor Author

oldbig commented Jan 30, 2022

Hi @tugcekucukoglu
Is this demo ok?

@tugcekucukoglu tugcekucukoglu added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Resolution: Invalid Issue or pull request is not valid in the latest version labels Jan 30, 2022
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 11, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.13.0 milestone Mar 11, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Mar 11, 2022
@tugcekucukoglu
Copy link
Member

Thanks for the codesandbox example. PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Projects
None yet
Development

No branches or pull requests

2 participants