title: Preserve text selection in contenteditable while interacting with jQuery UI Dialog and text input
body: <p>I have a jQuery dialog for making links in a contentEditable span. The problem is that clicking a button to open the dialog causes the selection to be lost, text input inside the dialog also causes the selection to be lost.</p>
  
  <p>I can fix the button with -moz-user-select:none; but -webkit-user-select:none doesn't work in Chrome.</p>
  
  <p>I can fix the input by wrapping it in an iframe, but that's messy and clicking anywhere else also kills the selection, for example, dragging the dialog around.</p>
  
  <p>I've seen the solution at <a href="https://stackoverflow.com/questions/824833/how-to-preserve-text-selection-when-opening-a-jquery-dialog">How to preserve text selection when opening a jQuery dialog</a>, but that doesn't work in many browsers in a contenteditable element, only real inputs.</p>
  
  <p>Is there a nice solution to my problem?</p>