ngx-lightbox
ngx-lightbox copied to clipboard
There is no way to stop event propagation
I've my lightbox control in modal dialog and when I press "Esc" it closes both lightbox and dialog.
I would be great if you can extend this._lightboxEvent.broadcastLightboxEvent method to pass $event as well (this._lightboxEvent.broadcastLightboxEvent({..., $event: $event})) so preventDefault() can be called from client side.
ightboxComponent.prototype._keyboardAction = function ($event) {
var KEYCODE_ESC = 27;
var KEYCODE_LEFTARROW = 37;
var KEYCODE_RIGHTARROW = 39;
var keycode = $event.keyCode;
var key = String.fromCharCode(keycode).toLowerCase();
if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
this._lightboxEvent.broadcastLightboxEvent({ id: lightbox_event_service_1.LIGHTBOX_EVENT.CLOSE, data: null });
Hi, I'm encountering the same behavior - open lightbox from a modal dialog and ESC closes both lightbox and the dialog.
A method to stop the event propagation would be great - maybe pass the vent as suggested, or a new option.
I'm working it around by checking if lightbox is open in my dialog close code and ignoring ESC if so.
Hi, no updates about this?