title: Quill.js - Unable to get selection range on a readOnly:true editor in Quill.js 0.20.1 -
body: <p><strong>Tool: Quill.js</strong>
  <strong>USE CASE</strong>
  To let user select a text range in a readOnly editor and apply highlighting.</p>
  
  <p><strong>Detailed Context</strong>
  I'm maintaining some code that's using Quill 0.20.1. I've created a readOnly:true editor to disable the content from getting changed. Even though text content in editor is readOnly I still want the user to be able to select, highlight and associate some metadata that references the selection made. (Basically I wanted to read what selection range the user made on quill editor)</p>
  
  <p>So I tried the following:</p>
  
  <pre><code>readOnlyHighlightable.quill.editor.selection.getRange(); // And it did not work
  </code></pre>
  
  <p>And trying to listen on event "selection-change" also doesn't seem to get invoked by events.</p>
  
  <pre><code>readOnlyHighlightable.quill.on("selection-change", function (range) {
      console.log(range);
  });
  </code></pre>
  
  <p>In contrast if I remove the readOnly flag from quill editor constructor it works well. Is this the desired behavior? Why is a readOnly editor not selectable?</p>
  
  <p>Finally, I created a plain editor (theme: snow and formats: ["background"]) and I tried disabling the editor with the following function and still the range function doesn't return the selected range.</p>
  
  <pre><code>quill.editor.enable(false);
  </code></pre>
  
  <p>If I do not call the enable(false) function, getRange() works fine.</p>
  
  <p><strong>Ref</strong>
  Range function:
  quill.editor.selection.getRange();</p>
  
  <p>Disable function:
  quill.editor.enable(false);</p>
  
  <p>PS. I'm excited about Quill 1.0 but this I've to implement this feature in Quill.js 0.20.1.</p>