Cannot Copy/Paste from/to CodeMirror using a mouse right-click menu with CSS3 rules applied #2154

Closed
opened 2014-01-17 20:44:02 +01:00 by marijnh · 2 comments
marijnh commented 2014-01-17 20:44:02 +01:00 (Migrated from gitlab.com)

Browsers: Firefox 26.0
OS: OSX 10.9.1
CodeMirror: Version 3.21

Problem:

Copying, pasting from CodeMirror is not available when the some CSS3 rules are applied to the parent container.

Simplified test case:

http://jsbin.com/ihunin/328/

Copy/paste options are not available in the mouse right-click menu with margin and backface-visibility + transform applied:

body {
  backface-visibility: hidden;
  transform: translate3d(0,0,0);
  /* Turning off margin fixes this issue */
  /* margin: 0; */
}

Turning off the margin on the body fixes this issue. However, its not possible in our case to turn off margins or remove the CSS3 rules to prevent content flicker on mobile devices.

Browsers: Firefox 26.0 OS: OSX 10.9.1 CodeMirror: Version 3.21 #### Problem: Copying, pasting from CodeMirror is not available when the some CSS3 rules are applied to the parent container. #### Simplified test case: http://jsbin.com/ihunin/328/ Copy/paste options are not available in the mouse right-click menu with `margin` **and** `backface-visibility` + `transform` applied: ``` css body { backface-visibility: hidden; transform: translate3d(0,0,0); /* Turning off margin fixes this issue */ /* margin: 0; */ } ``` Turning off the `margin` on the body fixes this issue. However, its not possible in our case to turn off margins or remove the CSS3 rules to prevent content flicker on mobile devices.
marijnh commented 2014-01-20 10:37:42 +01:00 (Migrated from gitlab.com)

I think this can be considered a Firefox bug -- when the body has a backface-visibility or transform rule applied to it, fixed positioning no longer actually positions the element relative to the viewport, but rather to the top-left corner of the body (also causing the element to scroll!). The problem is not present in other browsers, and completely breaks the things people use fixed positioning for.

So please file a bug with Firefox, and find some workaround (moving the styling to an element that's not the body should do it) in the meantime.

I think this can be considered a Firefox bug -- when the `body` has a `backface-visibility` or `transform` rule applied to it, fixed positioning no longer actually positions the element relative to the viewport, but rather to the top-left corner of the body (also causing the element to scroll!). The problem is not present in other browsers, and completely breaks the things people use fixed positioning for. So please file a bug with Firefox, and find some workaround (moving the styling to an element that's not the body should do it) in the meantime.
marijnh (Migrated from gitlab.com) closed this issue 2014-01-20 10:37:42 +01:00
marijnh commented 2016-01-26 16:21:05 +01:00 (Migrated from gitlab.com)

mentioned in issue #3238

mentioned in issue #3238
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#2154
No description provided.