mduvall / grande.js

It's a Medium at Starbucks. Pinky ring out.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-selectable nodes unselectable.

dylan-baskind opened this issue · comments

Hey there Matt,

I've run into an issue (may well be the idiosyncrasies of my setup?) where the other elements on my page that are not contenteditable / selectable by grande then become non-selectable (i.e. can't highlight text / select a text input etc.).

Narrowed it down to line 529 in the triggerTextSelection() function which returned false when an element wasn't contenteditable (i.e. 'cancelled' the selection event).

  function triggerTextSelection(e) {
      // The selected text is not editable
      if (!e.srcElement.isContentEditable) {
          return false;
      }

Again this could well be the particularities of my page setup, but if anyone else runs into the same issue, I got things back on track by returning from the function, but not returning false.

i.e.:

  function triggerTextSelection(e) {
      // The selected text is not editable
      if (!e.srcElement.isContentEditable) {
          return;
      }

Great work on this plugin!

Cheers,

Dylan.

That does look like the offending line, if you want to make a PR feel free! Thanks for finding that :)

Done. And no worries @mduvall - great to contribute to a fine piece of work!