mduvall / grande.js

It's a Medium at Starbucks. Pinky ring out.
MIT License
1.3k stars 80 forks source link

Non-selectable nodes unselectable. #53

Closed dylan-baskind closed 10 years ago

dylan-baskind commented 10 years ago

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.

mduvall commented 10 years ago

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

dylan-baskind commented 10 years ago

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