title: Typescript getSelection disappear
body: <p>In Vue and typescript I have my own context menu:</p>
  
  <pre><code>&lt;context-menu id="context-menu" ref="ctxMenu"&gt;
        &lt;li @click="ctxMenuClickItem1($event)" v-on:mouseover="menuItemMouseover($event)" v-on:mouseleave="menuItemMouseleave($event)" v-bind:style="getMenuItemStyle()" &gt;Open in TMS&lt;/li&gt;
        &lt;li @click="ctxMenuClickItem2($event)" v-on:mouseover="menuItemMouseover($event)" v-on:mouseleave="menuItemMouseleave($event)" v-bind:style="getMenuItemStyle()" &gt;Open in OnDemand&lt;/li&gt;
        &lt;li @click="doCopy()" &gt;Copy&lt;/li&gt;
      &lt;/context-menu&gt;
  </code></pre>
  
  <p>And when I selected text on the page and then I click third item in context menu (doCopy) the selection disappear.</p>
  
  <p>Do copy function looks like this:</p>
  
  <pre><code> doCopy: function () {
    debugger;
    var selection = window.getSelection();
  },
  </code></pre>
  
  <p>and after click selection is empty: selection.toString() is ""</p>
  
  <p>How to copy selected text?</p>