Permalink
Browse files

fix(enableescclose): default to true

  • Loading branch information...
devanp92 authored and PWKad committed Dec 14, 2016
1 parent c0baaf5 commit 58bfc882c71fbfd7ffca4248b233d450af54a61d
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/dialog-renderer.js
  2. +2 −2 test/unit/dialog-renderer.spec.js
View
@@ -47,7 +47,7 @@ export class DialogRenderer {
_escapeKeyEventHandler = (e) => {
if (e.keyCode === 27) {
let top = this._dialogControllers[this._dialogControllers.length - 1];
- if (top && (top.settings.lock !== true && !top.settings.enableEscClose)) {
+ if (top && (top.settings.lock !== true && top.settings.enableEscClose)) {
top.cancel();
}
}
@@ -68,7 +68,7 @@ describe('the Dialog Renderer', () => {
});
it('does close the top dialog, when not locked, on ESC', function (done) {
- const settings = { lock: false };
+ const settings = { lock: false, enableEscClose: true };
const expectedEndCount = 1;
const first = createDialogController(settings);
const last = createDialogController(settings);
@@ -130,7 +130,7 @@ describe('the Dialog Renderer', () => {
expect(last.renderer._dialogControllers.length).toBe(expectedEndCount);
last.renderer._escapeKeyEventHandler({ keyCode: 27 });
expect(first.cancel).not.toHaveBeenCalled();
- expect(last.cancel).not.toHaveBeenCalled();
+ expect(last.cancel).toHaveBeenCalled();
expect(last.renderer._dialogControllers.length).toBe(expectedEndCount);
done();
});

0 comments on commit 58bfc88

Please sign in to comment.