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

refactor: Change type from ClientRect to DOMRect #2481

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

2-NOW
Copy link
Contributor

@2-NOW 2-NOW commented Oct 24, 2023

Description

Hi I'm a developer following this project with interest. I was looking at the internal code and found something I could contribute, so I made a PR.

The ClientRect dom interface is deprecated in typescript 4.4 and you can use DomRect instead. I changed the observeElementRect.ts, ScrollArea.tsx, Slider.tsx, and useRect.tsx files that use the ClientRect interface to use DomRect.
Please let me know if you have any feedback to contribute. Thanks.

https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/d5f8ed6c1bdc0ad8b5953375f7813bc14b88c19a/baselines/dom.generated.d.ts#L5628

/** @deprecated */
interface ClientRect extends DOMRect {
}

dom.d.ts change log
microsoft/TypeScript-DOM-lib-generator#1029

…t.ts, ScrollArea.tsx, Slider.tsx, and useRect.tsx
@chaance chaance merged commit 41595ce into radix-ui:main Sep 26, 2024
1 of 3 checks passed
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.

2 participants