-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(core): Scroll listener register failure after unregister #10368
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
Conversation
This fix seems to have broken the
Basically, when updating to a NativeScript version that includes this fix, the |
Can you try to get rid of |
No, I was already testing that, and getting rid of the ngIf did not change anything. The component this is a part of is used as a subcomponent, and I even went and removed all the ngIfs up the chain to make sure. No matter what, the scroll event is not triggering. |
Please create an issue and add a reference to this PR. We'll take care as soon as possible. |
I will. I'm trying to get more info on this issue. I can create a scroll view elsewhere, even with an ngIf hiding the scroll view initially, and that scroll event fires correctly. I was hoping it would be something simple, but it looks like there's some complication in here that hasn't been accounted for. |
Okay, I've found the culprit. On our actual code, we were using a class to, among other things, add a background color that will change depending on the light/dark theme. If I remove the background color, the event fires normally. I was able to reproduce this using the following test code:
With the background color style in place, the scroll event does not fire. If I remove it, the scroll event fires normally. |
I have a brief idea of what's happening, thanks for testing. Could you still create a new issue so I can justify the new PR? |
PR Checklist
What is the current behavior?
There is a case that
ScrollView
scroll event listeners fail to register if aremoveEventListener
call occurs prior.e.g.
This occurs mostly on iOS because we don't unset property
_delegate
when detaching delegate.PR will take care of this and improve few other things for both platforms.
What is the new behavior?
Scroll listeners will register without problems.