What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 129 Stack Exchange communities.

When formatting already entered text by selecting it and then pressing one of the toolbar buttons the selection is ignored.

To reproduce:

  1. Select some text in the editor
  2. Hit one of the toolbar buttons that transform a selection, such as bold, italic, blockquote or code formatting.

Expected outcome:

The selected should be formatted.

Actual outcome:

The selection is cleared and the toolbar button behaves as if it was pressed without a selection, i.e. inserting new placeholder text, such as **strong text**.

share|improve this question
    
oddly enough it works fine if you use the keyboard shortcuts –  Jeff Atwood Mar 15 '11 at 11:04
    
As for the different behaviour when using the keyboard, @Jeff: maybe Unbalanced HTML tags confuse keyboard shortcuts for wmd editor is somehow related to this as well. I cannot test in IE9 though. –  Arjan Mar 15 '11 at 11:09
    
Hmm, sounds like somebody's spent some time on Connect. –  Won't Mar 15 '11 at 14:36

1 Answer 1

up vote 3 down vote accepted

Internet Explorer loses the selection when you click one of the buttons. To workaround this, the editor saves the selection in the mousedown event (when it is still there), so it has something to work with in the click event (when it's not there anymore).

The test whether this workaround needs to be used is based on the existence of the selectionStart property of the text area DOM object. Internet Explorer didn't have this property before.

In IE9 this property is available, but the issue is still the same, so the test for selectionStart wasn't enough anymore.

This will work again in the next build.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .