Right clicking inside CodeMirror instance causes textarea to show from then on #3241

Closed
opened 2015-05-06 19:58:53 +02:00 by marijnh · 8 comments
marijnh commented 2015-05-06 19:58:53 +02:00 (Migrated from gitlab.com)

This happens only in chrome and only in certain circumstances that I haven't been able to narrow down yet. When I right click my CodeMirror instance the hidden textarea shows up and never goes away.
image

It is caused by setting position: fixed here https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L1464, but removing the position: fixed from that cssText causes the context-menu to not have copy/cut/paste https://github.com/codemirror/CodeMirror/issues/3238

This happens only in chrome and only in certain circumstances that I haven't been able to narrow down yet. When I right click my CodeMirror instance the hidden textarea shows up and never goes away. ![image](https://cloud.githubusercontent.com/assets/7054/7499712/040c3924-f3ef-11e4-9f92-bfec833ffa61.png) It is caused by setting `position: fixed` here https://github.com/codemirror/CodeMirror/blob/master/lib/codemirror.js#L1464, but removing the `position: fixed` from that cssText causes the context-menu to not have copy/cut/paste https://github.com/codemirror/CodeMirror/issues/3238
marijnh commented 2015-05-06 19:59:50 +02:00 (Migrated from gitlab.com)

It seems like Chrome doesn't respect the position: absolute when it gets changed back in the rehide function.

It seems like Chrome doesn't respect the `position: absolute` when it gets changed back in the rehide function.
marijnh commented 2015-05-07 09:34:13 +02:00 (Migrated from gitlab.com)

I have added opacity: 0 to the textarea and everything seems to work. Anyone know of any issues it might could cause?

I have added `opacity: 0` to the textarea and everything seems to work. Anyone know of any issues it might could cause?
marijnh commented 2015-05-08 11:04:48 +02:00 (Migrated from gitlab.com)

So after putting back the cssText (which presumably contains a position: absolute) the element's .style.position is still "fixed"? I don't want to sweep the bug under the rug with an opacity: 0, I'd rather figure out what is going wrong and how we can work around it. Is there any way I can reproduce the issue?

So after putting back the `cssText` (which presumably contains a `position: absolute`) the element's `.style.position` is still `"fixed"`? I don't want to sweep the bug under the rug with an `opacity: 0`, I'd rather figure out what is going wrong and how we can work around it. Is there any way I can reproduce the issue?
marijnh commented 2015-05-08 19:00:24 +02:00 (Migrated from gitlab.com)

I haven't been able to figure out what causes this bug to manifest. I can tell you that where this bug shows up for me, that the screen shot above is from, is deeply nested inside several absolute positioned elements several of which are animated. I can actually cause this bug just by setting the textarea's position to fixed, then changing it back to absolute, with 0 right clicks.

I haven't been able to figure out what causes this bug to manifest. I can tell you that where this bug shows up for me, that the screen shot above is from, is deeply nested inside several absolute positioned elements several of which are animated. I can actually cause this bug just by setting the textarea's position to fixed, then changing it back to absolute, with 0 right clicks.
marijnh commented 2015-05-11 08:43:01 +02:00 (Migrated from gitlab.com)

Interesting. If you can submit a (minimal) test HTML page that allows me to reproduce this, that would be useful.

Interesting. If you can submit a (minimal) test HTML page that allows me to reproduce this, that would be useful.
marijnh commented 2015-05-30 00:12:26 +02:00 (Migrated from gitlab.com)

Hi, I have the same problem!! Any have a good solution!!!

Hi, I have the same problem!! Any have a good solution!!!
marijnh commented 2015-09-02 13:53:29 +02:00 (Migrated from gitlab.com)

Closing until a test case shows up.

Closing until a test case shows up.
marijnh (Migrated from gitlab.com) closed this issue 2015-09-02 13:53:30 +02:00
marijnh commented 2015-11-10 18:43:09 +01:00 (Migrated from gitlab.com)

Same issue here, we're using CodeMirror with ui-codemirror.

Don't know how to reproduce, but will submit a test HTML when I can reproduce it.

Same issue here, we're using CodeMirror with [ui-codemirror](https://github.com/angular-ui/ui-codemirror). Don't know how to reproduce, but will submit a test HTML when I can reproduce it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#3241
No description provided.