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: Malfunction inside Links #5030

Closed
havist opened this issue Jan 4, 2024 · 7 comments
Closed

Tooltip: Malfunction inside Links #5030

havist opened this issue Jan 4, 2024 · 7 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@havist
Copy link

havist commented Jan 4, 2024

Describe the bug

There is a serious bug with Tooltip when it's used inside Links. When so, it causes the infinite recursion when trying to bind listeners using Tooltip's bindScrollListener() method resulting with Uncaught RangeError: Maximum call stack size exceeded. The problem lies in DomHandler.getScrollableParents() utility that cannot properly read parent nodes. That's because in described case the condition checking parent for null in DomHandler's code below does not work (parent is undefined instead).

getParents: function getParents(element) {
    var parents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
    var parent = this.getParentNode(element);
    return parent === null ? parents : this.getParents(parent, parents.concat([parent]));
},

Reproducer

https://codesandbox.io/p/sandbox/hungry-gagarin-nm9xwy

PrimeVue version

3.45.0

Vue version

3.x

Language

ALL

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

Try the code in Sandbox and see the console.

Expected behavior

Tooltip should work w/o errors.

@havist havist added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 4, 2024
@tugcekucukoglu
Copy link
Member

Cannot open the codesandbox demo. Could you update the link?

@tugcekucukoglu tugcekucukoglu added Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 5, 2024
@havist
Copy link
Author

havist commented Jan 5, 2024

Well, could you try this share link then, please?

@vaibs30
Copy link

vaibs30 commented Jan 10, 2024

Do we have an update here?
It is certainly reproducible and in the case of Safari, the whole page hangs.

@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. labels Jan 11, 2024
@mertsincan mertsincan self-assigned this Jan 11, 2024
@mertsincan mertsincan added this to the 3.47.0 milestone Jan 11, 2024
@mertsincan
Copy link
Member

Thanks a lot, @vaibs30! We'll check before the next version release. Sorry for the delayed response!

Best Regards,

@mertsincan mertsincan 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 Jan 15, 2024
@mattlyons0
Copy link

mattlyons0 commented Jan 24, 2024

Hey I noticed this was supposed to be released in 3.47.0 recently but I'm not seeing it as fixed nor the changes in the published sources.

Here's an updated sandbox link to 3.47.1 where you can still reproduce the issue: https://codesandbox.io/p/devbox/hopeful-roman-dwn2qp
And if I open the sources of the installed package (node_modules/primevue/utils/utils.js) I still see the old logic in the built source:

getParentNode: function getParentNode(element) {
        var parent = element === null || element === void 0 ? void 0 : element.parentNode;
        if (parent && parent.host) {
          parent = parent.host;
        }
        return parent;
      },

(notice there is no reference to the added instanceof ShadowRoot check anywhere in the file)

See in browser via https://www.runpkg.com/?primevue@3.47.0/utils/utils.js#368

@mertsincan
Copy link
Member

Sorry for the confusion :/ There was confusion while merging from a different branch to master. I fixed it now. #5146 We will release the new version today. Thanks a lot for your report!

@mattlyons0
Copy link

No worries! Can confirm I'm seeing the fix in 3.47.2. Thanks

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
Projects
None yet
Development

No branches or pull requests

5 participants