Opened 10 years ago

Closed 8 years ago

#10083 closed defect (wontfix)

IE: Editor text selection fails if iframe not focused first

Reported by: Douglas Hays Owned by: Jared Jurkiewicz
Priority: high Milestone: future
Component: Editor Version: 1.3.2
Keywords: Cc: bill, wildbill, liucougar, Douglas Hays
Blocked By: Blocking:

Description

Using the mouse and IE, if you try to select text from an Editor that's not currently focused (via drag or double click), you cannot, and the result is that the Editor is focused, but nothing selected. This seems to work in non-IE browsers. It's not major, but it's 1 of those things that annoy users.

Attachments (1)

ie_selection.patch (914 bytes) - added by Jared Jurkiewicz 10 years ago.
Possible fix for IE selection not working on iframe activation.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbdfuture

comment:2 Changed 10 years ago by Jared Jurkiewicz

I'm not sure how you would 'fix' this, to be honest.

comment:3 Changed 10 years ago by Jared Jurkiewicz

Cc: bill wildbill liucougar Douglas Hays added

Okay, I think I came up with a fix for this, but I'm not fully understanding how the event sequence is occuring. Basically, when the select text in an iframe fails, I see *three* calls to onBeforeActivate, and they occur with these as the targets:

<div>
<body>
<div>

It's that call to <body> that seems to kill the selection ability. If I trap that and block it, I can select fine (and without any obvious adverse side effects). But I don't fully understand why it fires three times in the first place. Do any of you?

I worked up a patch to block that, along with some checks to verify that when the onBforeActivate was called, it occured via a programmatic call to focus, not a click. This is important because if you click and content was previously selected, well ... you'll restore it and clobber the user's selections. Though, will this cause issues with tabbing?

Patch attached. I'm going to continue to investigate.

Changed 10 years ago by Jared Jurkiewicz

Attachment: ie_selection.patch added

Possible fix for IE selection not working on iframe activation.

comment:4 Changed 10 years ago by Jared Jurkiewicz

Hm, that seems to break the Editor mouse tests. Back to the drawing board.

comment:5 Changed 10 years ago by liucougar

one possible explanation for the 3 onBeforeActivate events: one is triggered by the browser, then our code somewhere triggers the other 2. If that's the case, I think we want to find out why/when the other 2 are triggered

comment:6 Changed 10 years ago by bill

Could be. The connect is happening in RichText?'s onLoad so you should also make sure onLoad() isn't getting called twice. Or maybe [also] onBeforeActivate is bubbling?

It sounds like your change will break tabbing into the editor, although of course it's nice that it fixes mouse. Sounds like you want to restoreSelection() on focus except if the focus was caused by a mouseDown. I'm not sure of the order of the events, but if the onBeforeActivate event occurs between mousedown and mouseup then it should be easy to avoid restoring selection in that case.

comment:7 Changed 8 years ago by Jared Jurkiewicz

Resolution: wontfix
Status: newclosed

I cannot for the life of me figure out how to fix this. Just closing it instead of leaving this open forever.

Note: See TracTickets for help on using tickets.