Picker within Dialog "escape" key dismisses dialog instead of the suggestions
Bug Report
- Package version(s): 1.3.7
- Browser and OS versions: Chrome Version 56.0.2924.76 (64-bit) / Windows 10
Describe the issue:
If a picker is within a dialog then press "escape" key will automatically trigger the parent dialog to dismiss as well, even in the case we are overriding the onKeyDown to prevent the event propagate to the parent.
Further, we might want to be able to focus on "Cancel" button within the dialog when "escape" key is pressed, instead of directly dismissing without notice, please provide that functionality.
Actual behavior:
Expected behavior:
If a custom picker (with onKeyDown stopPropagating "escape" key) is within a dialog then press "escape" key in the picker's autofill box, only the suggestions should be dismissed, not the full dialog.
If applicable, please provide a codepen repro:
hi @stephenzsy I'll take a look.
@stephenzsy Okay, there are 2 problems causing this, 1 is that basepicker doesn't actually prevent propagation when you press escape and close the menu. The other problem is that popup get's the escape press before the basepicker does because it uses this._events.on.
@stephenzsy The code change I've put in will fix this problem once it get's approved.
This should be resolved, let me know if it's still a problem @stephenzsy