diff --git a/browser/src/control/Control.JSDialog.js b/browser/src/control/Control.JSDialog.js index fe8b987836597..39d8ddd950e94 100644 --- a/browser/src/control/Control.JSDialog.js +++ b/browser/src/control/Control.JSDialog.js @@ -35,6 +35,12 @@ L.Control.JSDialog = L.Control.extend({ .length > 0; }, + hasSnackbarOpened: function() { + return Object.keys(this.dialogs) + .filter(function (key) { return key == 'snackbar'; }) + .length > 0; + }, + clearDialog: function(id) { var builder = this.dialogs[id].builder; diff --git a/browser/src/map/handler/Map.Keyboard.js b/browser/src/map/handler/Map.Keyboard.js index e09a286eaf7d4..c000630285837 100644 --- a/browser/src/map/handler/Map.Keyboard.js +++ b/browser/src/map/handler/Map.Keyboard.js @@ -358,7 +358,8 @@ L.Map.Keyboard = L.Handler.extend({ if (this._map.uiManager.isUIBlocked()) return; - if (this._map.jsdialog && this._map.jsdialog.hasDialogOpened() + if (this._map.jsdialog + && (this._map.jsdialog.hasDialogOpened() || this._map.jsdialog.hasSnackbarOpened()) && this._map.jsdialog.handleKeyEvent(ev)) { ev.preventDefault(); return;