feat(dialog): ability to specify dialog per open call #1978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📖 Description
Addresses the need mentioned in #1671 and the dialog rfc at #1713 . This PR adds:
the ability to specify a custom renderer, simply and inline in the
dialogService.open
call, like the following example:Notice the object given to the
renderer
property, it should satisfy the interface of anIDialogDomRenderer
:an event manager extension point for custom event handling.
With the ability to specify different renderers for different
.open()
call on the dialog service, it's becomes necessary to be able to have a flexible event handling strategy. So instead of leaving it hidden inside the dialog service & dialog controller, extract it into a separate block for extensibility. An example of byo dialog event manager is as follow:🎫 Issues
resolve #1671 - I'll be closing this, if you disagree with any points here and want changes, let's have a new PR
resolve #1713
@ekzobrain
is addressed, as we can decide what to do with each controller in your own implementation, per application. This I think is better than assuming a
tabindex
on the overlay, as it requires the overlay to be focused in the first place, which won't always be the case.The following 2 concerns
are also addressed, as now you can always override the event handler with your own and add/remove event listeners the way you see fit. You can check how the default event listening is done in the default implementation.