This is a migrated thread and some comments may be shown as answers.

[Solved] Focus event in Firefox

3 Answers 158 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 06 Apr 2009, 04:40 PM
We are using multiple RadEditor controls on a single page. We need to add an event handler to the focus event for each editor. This code is working fine in Internet Explorer, but it is not working in Firefox.

Here is the code:

var OnTelerikClientLoad = function(editor, args) {

            var element = document.all ? editor.get_document().body : editor.get_document();

            $telerik.addExternalHandler(element, "focus", function(e) {

                alert("focus!");

            });

            $telerik.addExternalHandler(element, "blur", function(e) {

                alert("blur!");

            });

}

Neither the focus or blue alerts are firing.

Any suggestions?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Apr 2009, 02:47 PM
Hello Vijay,

This code looks fine and it works as expected for me with multiple editors in IE and Firefox.  For your convenience I have attached my test project here and video showing my test.

Please, test the project and let me know if you still experience the problem.


Kind regards,
Rumen
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Vijay
Top achievements
Rank 1
answered on 10 Apr 2009, 06:17 PM
The problem appears to be due to our specific usage of the RadEditor. We have the editors hidden (using "display:none") within a div when the page is first loaded. We are attaching the events once the control is loaded. We also move this div around the page dynamically. The problem seems to be due to one or both of these factors. We have been able to attach the "focus" event once the outer div is visible and moved appropriately. We still have to fine tune this to fit our issues, but I wanted to give an update.

Thanks for the response.

0
Tervel
Telerik team
answered on 13 Apr 2009, 08:10 AM
Hello Vijay,

The scenario you describe (hidden editor as well as moving it around the DOM) can definitely cause trouble.
In case you come across another issue, please let us know and we will do our best to help you.

All the best,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Vijay
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Vijay
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or