Disabling Editor "Focus" on Document Ready

Integration questions/issues
Post Reply
enigma
Posts: 4
Joined: Mon Jan 22, 2018 3:02 pm

Disabling Editor "Focus" on Document Ready

Post by enigma » Mon Jan 22, 2018 3:13 pm

We use the Document Server within our application.

When the editor loads a new document, it gets focused. This focus event scrolls automatically down to the editor.

How can I prevent this? Where in the code can I comment this line?

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: Disabling Editor "Focus" on Document Ready

Post by Maxim » Tue Jan 23, 2018 8:19 am

Hello enigma!
This focus event scrolls automatically down to the editor
Attach a screenshot please.

enigma
Posts: 4
Joined: Mon Jan 22, 2018 3:02 pm

Re: Disabling Editor "Focus" on Document Ready

Post by enigma » Tue Jan 23, 2018 9:23 am

Please see attached a screenshot.

The user clicks a button, the form/popup (as shown in the attachment) appears. After the document in the editor is loaded completely, it gets the focus and the browser scrolls down so that the editor is active. If the user previously clicks on a input field above the editor, it looses the focus. Im pretty sure that your code contains some logic like $('iframe').focus(), but I can't find it.

I basically want to disable the focus event of the editor.
Attachments
Selection_001.png
Selection_001.png (52.75 KiB) Viewed 1715 times

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: Disabling Editor "Focus" on Document Ready

Post by Maxim » Wed Jan 24, 2018 6:08 am

Hello enigma!
Maybe this can help you!

enigma
Posts: 4
Joined: Mon Jan 22, 2018 3:02 pm

Re: Disabling Editor "Focus" on Document Ready

Post by enigma » Wed Jan 24, 2018 8:16 am

There actually is one piece of code that does exactly what I mean - but only for mobile!

(line 216):

Code: Select all

if (_config.type === 'mobile') {
                document.body.onfocus = function(e) {
                    setTimeout(function(){
                        iframe.contentWindow.focus();

                        _sendCommand({
                            command: 'resetFocus',
                            data: {}
                        })
                    }, 10);
                };
            }
Any idea where I can get this type of code or DESKTOP? There is no other part that requests the focus...

Maxim
Posts: 1751
Joined: Tue Oct 11, 2016 2:34 pm

Re: Disabling Editor "Focus" on Document Ready

Post by Maxim » Mon Jan 29, 2018 8:35 am

Hello enigma!
I was informed that this problem with "Focus" will be fixed to next release.

Post Reply