-
Notifications
You must be signed in to change notification settings - Fork 441
window.scrollTo behavior option missing "instant" string literal union #1195
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
Comments
Hey, I just ran into this issue as well. It looks like according to the CSSOM spec there is no You can see in the CSS Overflow Module Level 3 that However, I've checked and both Firefox and Chrome deviate from the spec and allow the use of |
It seems this is intended. The |
For my case I have to use |
I'm running into basically the same issue as @aquaductape: What works (in browsers) is |
|
The proposed merging of "instant" with "auto" along with the described resolution algoritm of the "auto" behavior value, remove a perfectly valid use case/feature, without as much as a hint of justification or even mentioning it. After the change This spec change looks like a mistake, IMO β a resonable hypothesis as the linked document is in an "editor's draft" state:
β https://www.w3.org/standards/types#ED (Emphasis mine) Thus, I argue that this change in TypeScript's lib is premature, and someone should raise an issue with W3C's CSSWG regarding this, instead of pressuring browser makers to act on it in haste. |
@maranomynet yes, that makes sense! |
Thanks people! Filed w3c/csswg-drafts#7773. |
should closed by #1481 |
Right, thanks. @github-actions close |
Closing because @saschanaz is one of the code-owners of this repository. |
When I run npm run build, it says that "instant" isn't a valid value for type ScrollBehavior. My code is document.documentElement.scrollTo({ and window.scrollTo({ |
If it's still an issue, in my case I was using
|
If this is still an issue, please consider updating TypeScript. |
Bug Report
window.scrollTo behavior option has three types: "smooth", "instant" and "auto", but typescript doesn't have "instant" value.
π Version
v4.4.4
β― Playground Link
https://www.typescriptlang.org/play?#code/O4SwdgJg9sB0DOBjATlANmgKlAFAbwCMBTACwEMA3EKZALgAIByceAFzLFcYF8BKIA
π» Code
The text was updated successfully, but these errors were encountered: