0

How to achieve opportunity copy content from popup-open?

In OpenLayers-2 I could select part of content popup and copy it.

In OL-3 miss this option.

Popup-open has disable default option select content from popup.

Bear
  • 151
  • 1
  • 1
  • 9

1 Answers1

1

I think this is related to this issue: https://github.com/openlayers/openlayers/issues/6720

However I think setting user-select: auto for the .ol-selectable class doesn't have the desired effect as according to the spec the value of auto will results in none if the computed value of user-select on the parent of this element is none, which it is in OpenLayers due to user-select being set on the .ol-viewport.

Try adding this CSS to your page after the OpenLayers CSS is loaded:

.ol-selectable {
    -webkit-touch-callout: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
walkermatt
  • 338
  • 1
  • 3
  • 12
  • I've just created a pull request which should address the issue: https://github.com/openlayers/openlayers/pull/8030 – walkermatt Mar 26 '18 at 13:20
  • Sorry, at me this solution doesn't work. Changed ol.css library ol v 4.6.4 and without luck. Anyway thanks for reply and pull request to OpenLayers. – Bear Apr 03 '18 at 10:13
  • Doesn't work in popup-open. But works in popup-hover... strange. – Bear Apr 03 '18 at 10:31
  • Everything works proper. I have ol-ext library with ol-selectable { ...:none } Many thanks! – Bear Apr 03 '18 at 12:09