st-h / ember-content-editable

A contenteditable component for ember-cli that just works™
MIT License
66 stars 31 forks source link

Handle pasting of blank lines #32

Closed orf closed 6 years ago

orf commented 7 years ago

Thank you for this awesome library!

We ran into an issue today. If a user pastes a blank space into the input (why they would want to is beyond me...), an error is thrown on this line range.setStart(_this.element.childNodes[0], start + content.length);, due to _this.element.childNodes being an empty array.

I'm guessing it's because whitespace is insignificant and so is truncated away, or something, but this MR just skips processing of pastes that consist of nothing but whitespace.

st-h commented 6 years ago

Hey @orf, I have taken over this addon and tried to reproduce this issue but failed to do so using latest chrome on mac. Does this issue still persist? If so, is this a browser specific issue or related to a specific config? Would you mind adding a test in case this still is an issue?

st-h commented 6 years ago

closing this for now. please feel free to reopen if this is still an issue