-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
feat(material/core): Allow namespacing ripple-loader event handler #28699
Conversation
ripple-loader registers an event handler on the document to do event delegation. If there are multiple instances of ripple-loader on one page, then they will both try to handle events for [mat-ripple-loader-uninitialized] elements. If a namespace is provided, then the handler will only handle events for [mat-ripple-loader-uninitialized="{namespace}"] elements.
@RussellSprouts Could you provide an example for this use case? I'm having trouble understanding how multiple instances of the ripple-loader are being instantiated when this service should be provided in root |
The internal bug is b/309675388 for more context. I agree that there's no normal way to have multiple instances, but we have a special virtualization framework to embed a guest Angular app in our shell Angular app. The guest app code runs in an invisible iframe, and we virtualize the DOM so that the guest app elements are actual in the parent frame. So both ripple-loader instances are listening to events on the same document |
LGTM, but I feel like a better route could be to disable the ripple loader for nested angular apps. It might even be possible to automate the detection of nested apps so that there is no need for apps to first run into this issue and then go configure their global ripple config |
Is there something I can do to re-trigger the internal presubmits to unblock this? |
Merging this since the corresponding internal change was submitted. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ripple-loader registers an event handler on the document to do event delegation. If there are multiple instances of ripple-loader on one page, then they will both try to handle events for [mat-ripple-loader-uninitialized] elements. If a namespace is provided, then the handler will only handle events for [mat-ripple-loader-uninitialized="{namespace}"] elements.