Jump to content

Recommended Posts

Posted

Hi,

 

One of the possible solution, while, try:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS('Ext.get("'+ UniHTMLMemo1.JSName +'_id-inputCmp-iframeEl").focus()');
end;

Best regards.

  • Upvote 1
  • 3 weeks later...
  • 2 years later...
Posted

Hi,

 

One of the possible solution, while, try:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS('Ext.get("'+ UniHTMLMemo1.JSName +'_id-inputCmp-iframeEl").focus()');
end;

Best regards.

 

This code is not working in my project.
It does not display any errors but the focus is not set.
 
I am using version 1.0.0.1422.
 
Any suggestion?
Posted

Hi,

 

Thanks for the testcase,

 

Online demo example works for me.

 

Which browser are you using ?!

 

I'm using "Google Chrome Version 63.0.3239.132 (Official Version) 64-bit (Last Update)"

In Internet Explorer 11 there is also a problem.

 

 

The problem continues even with the code being reported.
UniSession.AddJS('Ext.defer(function(){Ext.get("'+ UniHTMLMemo1.JSName +'_id-inputCmp-iframeEl").focus()},100)');

In firefox it works perfectly.

Posted

 

Can you try this approach ?!:

UniHTMLMemo1.JSInterface.JSCall('focus', []);

 

Internet Explorer 11 and Firefox are working perfectly.
But in Google Chrome the problem continues.
Posted

Hi,

 

Any suggestion?

 

Ok, can you try to use this approach for now ?!:

//UniHTMLMemo1.JSInterface.JSCall('focus', []);
UniHTMLMemo1.JSInterface.JSCode('if (Ext.isChrome) {'#1'.iframeEl.el.dom.contentDocument.body.focus()} else {'#1'.focus()};');

Best regards,

Posted

Hi,

 

 

Ok, can you try to use this approach for now ?!:

//UniHTMLMemo1.JSInterface.JSCall('focus', []);
UniHTMLMemo1.JSInterface.JSCode('if (Ext.isChrome) {'#1'.iframeEl.el.dom.contentDocument.body.focus()} else {'#1'.focus()};');

Best regards,

Perfect.
 
Thank you very much for your attention.
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...