fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Picker within Dialog "escape" key dismisses dialog instead of the suggestions

Open stephenzsy opened this issue 9 years ago • 4 comments

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:

stephenzsy avatar Feb 01 '17 22:02 stephenzsy

hi @stephenzsy I'll take a look.

joschect avatar Feb 01 '17 22:02 joschect

@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.

joschect avatar Feb 01 '17 22:02 joschect

@stephenzsy The code change I've put in will fix this problem once it get's approved.

joschect avatar Feb 02 '17 00:02 joschect

This should be resolved, let me know if it's still a problem @stephenzsy

joschect avatar Feb 21 '17 17:02 joschect