Bug #4841

Up/Down Cursor in Firefox 7/8 screwed after using .focus()

2011-11-11 18:53:57 By: yellowswordfish
firefox firefox
Open Priority: 3 Resolution: None Assigned to: None
Description of problem:
Using tinyMCE.activeEditor.focus() or tinyMCE.activeEditor.selection.setContent() loses the ability to use the cursor up/down keys within the edit window. Instead the arrow keys scroll the page.

Steps to reproduce:
1. In our case a page is loaded with a tinymce instance and a button can be clicked to (a) scroll to the editor section and (b) place the cursor in the edit window.
2. This calls a js routine that uses tinyMCE.activeEditor.focus()
3. The cursor is indeed in the edit window and yoy can type and use the editor correctly.
4. using the up/down/pageup/pagedown keys does not move the cursor from line to line or top to bottom as expected but scrolls the entire page.
5. Note this is ONLY on Firefox. At least version 7 and 8 - probably 6 as well.
6. We are using TinyMCE version 3.4.6

Expected result: Cursor movement within edit window

Actual result: Cursor movement no longer bound to edit window


If you wish to follow or post a comment, you need to be registered and logged in.


User Image
  • 2011-12-27 16:35:36


It seems using .focus() messes up more than the usage of cursor keys. We've been having problems with resize handles on images, which do not appear anymore when tinymce calls .focus() on the body of the editor iframe.

User Image
  • 2012-01-05 11:50:01


Same here. A severe consequence is that if you try to use the arrow keys without success and then press backspace, you will go back in browser history and may loos all your content if you have no mechanisms in place to prevent this.

Is there a workarround?