This is a migrated thread and some comments may be shown as answers.
OnParentChanged still steals focus on hidden RadEditor
5 Answers 8 Views
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 01 Oct 2014, 01:10 PM
Hi,

I use the RadEditor inside a input form with dynamic content. Dependent of the selected record in a Radgrid different input control become visible. When an input control is not visible, its replaced to a seperate div to make room for other input controls. Because the RadEditor is replaced on the DOM I call editor.OnParentChanged() to let the RadEditor behave as expected especially in Firefox and IE 10 and lower. If I don't the RadEditor steals focus and its content becomes empty.

This works great when the RadEditor becomes visible, but when the RadEditor becomes invisible it still steals the focus.This is a problem for pressed shortkeys in the RadGrid to navigate through records because they stop work after the focus is stolen. The content of the RadEditor stays filled when it is invisible as expected.

The strange thing is, the focus is not stolen the first time the RadEditor becomes invisible.

Any ideas what goes wrong in my situation?

5 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 06 Oct 2014, 06:28 AM
Hello Erik,

Using the OnParentNodeChange, automatic focusing of the editor is expected and it is the way this method is designed to act.

This method is used to fix the editor when moved trough the DOM. It attaches all needed events with te core functionality and repaints the editor according the wrapper's size. Using it on an invisible editor is incorrect.

Due to that I suggest redesigning the behavior by implementing a logic that calls the OnParentNodeChanged only when the editor is shown.  

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Erik
Top achievements
Rank 1
answered on 06 Oct 2014, 07:06 AM
Hi Lanko,

"Using the OnParentNodeChange, automatic focusing of the editor is expected"
This is not the behavior I notice when the control stays visible. That's one of the issues the OnParentNodeChange fixes in my case, because the user is not working with the editor at that moment so the focus should stay at the element the user is working with.

I tried already not calling the OnParentNodeChanged when the RadEditor becomes invisible, but the RadEditor kept stealing focus.
Can you provide me a solution for the problem I subscribed in my first post so the RadEditor won't steal the focus?
0
Ianko
Telerik team
answered on 06 Oct 2014, 12:28 PM

Hi Erik,

Could you please clarify some further matters on the implemented project, so that I could research further the encountered behavior?

  • Is the focus stolen when the page is loaded or after some user interaction?
  • How is the RadEditor control added to the grid?
  • Does the editor become visible/invisible via client-side logic  or server-side?

Any additional informaiton on the matter will help me better understand the situation.

Regards,

Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Erik
Top achievements
Rank 1
answered on 06 Oct 2014, 12:54 PM
Hi Ianko,

"Is the focus stolen when the page is loaded or after some user interaction?"
The focus is stolen after changing the selected row in the RadGrid. After user interaction.

"How is the RadEditor control added to the grid?"
The RadEditor is not added to the RadGrid, but underneath it displaying a value of the selected row in the RadGrid. Another column with checkboxes in the RadGrid is used to decide whether the RadEditor is visible or not.

"Does the editor become visible/invisible via client-side logic  or server-side?"
The RadEditor becomes invisible via client-side logic.

Regards,
Erik
0
Ianko
Telerik team
answered on 08 Oct 2014, 08:45 AM
Hi Erik,

I suggest modifying the way the RadEditor gets invisible. Try if setting the Visible property to false through code behind logic resolves the issue.

If you still have difficulties with the matter, please provide a simple, isolated project that can be locally investigated to further examine the situation.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Asked by
Erik
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Erik
Top achievements
Rank 1
Share this question
or