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

getScrollingParent() causes runtime error in custom elements #742

Closed
corrupt opened this issue Jan 23, 2024 · 0 comments · Fixed by #794
Closed

getScrollingParent() causes runtime error in custom elements #742

corrupt opened this issue Jan 23, 2024 · 0 comments · Fixed by #794
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@corrupt
Copy link

corrupt commented Jan 23, 2024

Overview of the problem

Oruga version: [0.8.2]
Vuejs version: [3.1.1]
OS/Browser: macOS 14.2.1/Firefox 121 (64-bit)
OS/Browser: macOS 14.2.1/Chrome 120 (64-bit)

Description

The getScrollingParent() function will blindly traverse up the DOM tree, looking for a parent element that would scroll the current one.
When Oruga is used in custom elements, that traversal will eventually lead .parentElement to resolve to null upon reaching the root of the shadow DOM, which is not accounted for.

Steps to reproduce

I've created a minimal example to reproduce this.

To try it out:

git clone https://github.com/corrupt/oruga-taginput-test.git
cd oruga-taginput-test
npm install
npx vite build && npx vite preview

Then visit http://127.0.0.1:4173/, open dev console, click in the control and type j.

Expected behavior

No error should occur

Actual behavior

TypeError: Window.getComputedStyle: Argument 1 is not an object. is thrown.

@corrupt corrupt changed the title getScrollingParent causes Exception in custom elements getScrollingParent() causes runtime error in custom elements Jan 23, 2024
@mlmoravek mlmoravek added the bug Something isn't working label Jan 30, 2024
@mlmoravek mlmoravek added the good first issue Good for newcomers label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants