1

Oddly enough, it seems Webkit doesn't like editor.selection.setCursorLocation(span), where span is an empty span with styling:

Typing after setting it this way, does not type within the styled span. Is this a known bug in Chrome - or TinyMCE? Other browsers were fine, but Chrome requires something (like a space) in the element, for it to setCursorLocation, then type into styled area.

Is this the only purpose of those <br data-mce-bogus nodes?

NoBugs
  • 9,310
  • 13
  • 80
  • 146

1 Answers1

1

It's how WebKit behaves. I would say it's not a bug as such, although there is a issue on the WebKit issue tracker that has been around for years:

https://bugs.webkit.org/show_bug.cgi?id=15256

Here's another question where this is mentioned:

https://stackoverflow.com/a/5489006/96100

Community
  • 1
  • 1
Tim Down
  • 318,141
  • 75
  • 454
  • 536
  • The linked Chromium bug at the bottom of that bug report shows that a bug fix should be coming up soon... Do you know how to check for the version of Blink that fixes this? https://code.google.com/p/chromium/issues/detail?id=346613 – NoBugs Jun 18 '14 at 01:31
  • @NoBugs: The best way would be to check for the bug explicitly by placing the caret inside an empty element, inserting some content and then checking the contents of the span. Demo: http://jsbin.com/diyexeka/4 – Tim Down Jun 18 '14 at 09:14