Stop keyboard event propagation when the dialog is open.