-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
add scrollTop and scrollLeft bindings #3895
Conversation
Actually, I don't think this is quite right. The timeout (which is designed to prevent scroll being set in response to a scroll event) is preventing spring/tweened values from controlling scroll, which isn't what we want. This might also affect |
What about an approach where you simply set an ignore flag that's cleared in the scroll handler, following https://stackoverflow.com/a/1386750 |
I've implemented something like this for one of my projects. It's determined whether the scroll was user-triggered or script-triggered. We can tell because scripts have to set a variable when trying to scroll. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review and Improvement Suggestions:
Error Handling: The refactoring introduces a more consistent approach to error handling by returning errors directly from the function where appropriate. This can improve clarity and maintainability, as each condition now directly returns an error message.
Functionality: Ensure that compiler_errors.invalid_binding(binding.name) correctly generates the error message for invalid bindings. It's important that this function correctly encapsulates the logic for generating error messages based on the binding name.
Readability: Both versions are similar in terms of structure and logic flow, which is good for readability and understanding. Continue to maintain this clarity throughout your codebase.
Testing: After making changes to error handling, it's crucial to test the code to verify that errors are properly thrown and handled under different scenarios.
Documentation: Consider documenting error handling strategies, especially if they involve custom error messages or specific conditions that might not be immediately obvious to others reading the code.
By following these suggestions, you can ensure that your error handling is robust and consistent across your codebase, leading to better maintainability and understanding for future development and maintenance tasks.
Closing Svelte 4 PR as stale |
fixes #3780. The binding code gets hairier and hairier... at some point it will probably need a bit of a spring clean