Dialog vs. background input focus

Hi,
Please help.

I have an input field input.
Contains data validation.
“App.dialog.create” opens when data is entered incorrectly

However, the focus remains on the original input.

  • The user can then use the HW keyboard to re-enter the data and resend the input.

JDWPOJDPOW

Attempt to block ENTER (broken solution)

app.dialog.create({
            title: 'no valid input data',
            text: 'text',
            keyboardActions: false,
            on: {
                open: function () {
                    console.log('Dialog opened');

                    // attempt to lock the keyboard
                    document.onkeydown = function (e)
                    {
                        return false;
                    }
                    if (window.event.keyCode == 13 ) return false;
                    // attempt to change focus out of input
                    document.getElementById('div_tlacitka').focus();

                },
                close: function () {
                    console.log('Dialog closed');

                    InputFocusKeyboard('input_pozice');
                }
            },
            buttons: [
                {
                    color: 'red',
                    text: 'ne',
                    keyCodes: [13]
                },
                {
                    text: 'ano',
                },
            ],
        }).open();