-
Notifications
You must be signed in to change notification settings - Fork 9
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
Console error "cannot calculate scrollbar size because it is removed" #35
Comments
This is the commit that added this message. @theKashey what's the purpose of this? Thanks for your help! |
The error message is displayed only during development and should cause any trouble for a real customer, and I can replace the error with a warning if that would work for you. The change itself was a fix for theKashey/react-remove-scroll#71 (issues are often raised for library consumers) and logging was added to reduce "wtf per minute" - the most important metric I have. |
Makes sense. I think a warning is more fitting too. Thanks for your help! |
Not completely aware how react-remove-scroll-bar does it's magic but should it somehow track with css class or something that if it has already hidden the scrollbar? Then it would not matter if react-remove-scroll-bar would be initialised multiple times. |
It tracks "own" classes but is not able to handle third-party ones. Can only report an issue |
@theKashey Hi! Do you still plan to update the error with a warning? Thanks |
Absolutely. |
No I mean if react-remove-scroll-bar component is mounted twice each of them executes getGapWidth => getOffset which has the error mentioned in this ticket. And the latter will always fail as react-remove-scroll-bar itself sets body as overflow hidden. Therefore I was thinking it could set react-remove-scroll-bar-initialized css class, etc. to body and if it's set the later instances would know not to do anything. Context provider could be another solution. |
It would make sense to allow disabling that warning, because I have overflow: hidden on body and having that warning on every interaction with radix-ui components. It's a transitive dependency for me, so I would need a way to disable it from "outside". |
😕 this should not happen, and that's definitely a bug. |
fix: remove measure time error reporting, fixes #35
Particularly this issue has been resolved. Version update propagation might take a while and if you need results here and now - you will need to find
|
When an app XYZ is using a library that in turn is using
react-remove-scroll-bar
and at the same time, the XYZ app has the scrollbar removed for a different reason that can't be avoided.So the app has something like the following:
<body style="overflow: hidden;">
Then a
console.error
is logged in the console.Can we avoid logging this error?
The text was updated successfully, but these errors were encountered: