[wp-trac] [WordPress Trac] #31661: Quicktags: Can't add them using just a keyboard in IE

WordPress Trac noreply at wordpress.org
Fri Mar 27 02:19:42 UTC 2015


#31661: Quicktags: Can't add them using just a keyboard in IE
----------------------------------+----------------------------------------
 Reporter:  Cheffheid             |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Editor                |     Version:  4.1
 Severity:  normal                |  Resolution:
 Keywords:  has-patch needs-      |     Focuses:  accessibility, javascript
  testing                         |
----------------------------------+----------------------------------------

Comment (by Cheffheid):

 I think this'll do it. Not quite the same logic as you suggest, but it's
 similar I guess.

 IE11 supports getSelection, but doesn't return anything when the selection
 is in a textarea. When getSelection is supported, it will instead store
 the start and end of the selection in an array. If it's not, it'll
 continue business as usual with a snippet I had found in bookmarklet.js.

 Might not need the `document.getSelection()` check, I'm not too sure.

 Anyhow, with this patch it seems that all modern browsers will now set
 `keyboardSelectionIE` (because they all support `window.getSelection()`,
 so that makes sense) and so I'm not sure if the additional else clause on
 lines 537 - 540 are even needed anymore either.

 I did a quick test with mouse and keyboard in IE 11, Firefox 36, and
 Chrome 41 on Windows and all seems to be functioning as expected. Would
 appreciate some help testing and help/direction cleaning/reviewing the
 code. :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31661#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list