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

useScrollIntoView returns RefObject instead of MutableRefObject #5426

Closed
1 of 2 tasks
daler-sz opened this issue Dec 15, 2023 · 1 comment
Closed
1 of 2 tasks

useScrollIntoView returns RefObject instead of MutableRefObject #5426

daler-sz opened this issue Dec 15, 2023 · 1 comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@daler-sz
Copy link

daler-sz commented Dec 15, 2023

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.3.2

What package has an issue?

@mantine/hooks

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Not applicable – issue is not related to the browser

Describe the bug

The scrollableRef and targetRef fields of result of useScrollIntoView hook are RefObject, not MutableRefObject as it is presented here

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

I think it can be fixed by fixing type declarations, namely just replacing RefObject by MutableRefObject in useScrollIntoView declaration and by changing this line

to

Target extends HTMLElement | null

Self-service

  • I would be willing to implement a fix for this issue
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Jan 3, 2024
@rtivital
Copy link
Member

rtivital commented Jan 9, 2024

Fixed in 7.4.1

@rtivital rtivital closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants