Hi, we have a weird problem.
We have a modal, which has two buttons, one of them set to the default button.
We have realized that, for some reason, this modal is rendered in the HTML in the KeyPress of all the inputs of the page, as indicated in the photo.
Due to this, we have had a bug in which a user has launched the keypress when entering with the keyboard, the modal has not been opened, but has executed its default action.
We have reviewed all the code but we have not seen the reason why it is associated with the inputs and worse, because it has not been opened in that case and has directly launched the default action
Can you help us?
Hi @CrisSanz
Any update on this? Have you managed to solve this issue? If so, can you share the solution with the community?
I just created a quick test and by adding a new handler to the button you can prevent that (even though I was not able to reproduce the scenario you mentioned):
Cheers,GM
I had a similar issue, so i added a JS forbidding that modal to open
if (keyPressed && keyPressed > 36 && keyPressed < 13) {
ev.preventDefault();
ev.stopPropagation();
}
You can use this Javascript in your Screen--> Advanced--> Javascript
$(document).ready(function() {
$(window).keydown(function(event){
if(event.keyCode == 13) {
console.log('keypress event');
event.preventDefault();
return false; }
});