User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20160407164938 Steps to reproduce: Open any page with an editable <textarea> or text <input> element. Write some text in it if there is none. Select anything (say, a word) in that element. Write document.activeElement.setRangeText("HELLO WORLD") in the F12 console. Press Ctrl+Z. Actual results: Change undone, but selection isn't preserved: whole text gets selected. Expected results: Text that was selected before the operation should be selected. This is important for various forums where you need to insert BB codes, because there's currently no known way to insert text into a text area that's undo-friendly in the described sense.
3 years ago
Component: Untriaged → Selection
Product: Firefox → Core
It seems that setRangeText erases the entire history now. Name Firefox Version 60.0b1 Build ID 20180302190033
You need to log in before you can comment on or make changes to this bug.