Open Romanchuk opened 6 years ago
This is a breaking change and a specific behavior for your specific use case.
If I do this change, someone else will say, I want the default behavior to be "any key opens..."
This is why I don't think it should change.
When you want to cancel keyboard completely set it to null.
You can easily build a service that wraps the modal service and set's this value for you instead of doing it every time.
I'm submitting a ... [ ] bug report [x] feature request [ ] question about the decisions made in the repository
Do you want to request a feature or report a bug? feature function supportsKey(keyCode: number, config: Array) should behave the same way whenever config value is 'null' or 'undefined'.
Case: modal dialog has no keyboard config setted.
That is what i do on dialog creation to workaround it:
What is the expected behavior? Do not close modal on any key by default (keyboard config is null or undefined)
What is the motivation / use case for changing the behavior? I'm implementing custom modal plugin that has no keyboard behave. The problem is by default any modal closing on any keypress.
Please tell us about your environment:
Angular version: 5.0.1
Browser: [all]
Code sample: