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

fix: null return for root bounds being null on dom rect #55

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

alexh-compyl
Copy link
Contributor

@alexh-compyl alexh-compyl commented Jan 3, 2025

In the instance root bounds is null on a DomRectReadOnly, an exception is being thrown. rootBounds can legitimately be null in cases where there is no root intersection observer container defined, which is happening during an operation in our drag and drop implementation.

Fixes #49

@alexh-compyl alexh-compyl marked this pull request as draft January 3, 2025 22:44
@alexh-compyl alexh-compyl marked this pull request as ready for review January 3, 2025 22:45
@ljbc1994
Copy link
Owner

ljbc1994 commented Jan 6, 2025

@alexh-compyl Thanks for the PR! Will look to get this merged!

@@ -68,6 +68,7 @@ function remove(callbackId) {
}
function toEntryObject(entry) {
function toRectReadOnlyObject(obj) {
if (!obj) return null;
Copy link
Owner

@ljbc1994 ljbc1994 Jan 6, 2025

Choose a reason for hiding this comment

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

Could we update /src/index.ts with this change?

Then you can run npm run build which will update the .js file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha! Sorry about that. I was just debugging it and didn't even think to modify the actual typescript. Change has been made!

@ljbc1994 ljbc1994 merged commit cf81a8c into ljbc1994:master Jan 28, 2025
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.

Uncaught TypeError: Cannot read properties of null (reading 'x')
2 participants