-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Deleting highlighted text deletes old selection #849
Comments
@drewjenkins - thanks for opening this. this is crazy, definitely a bug. are you able to see it on the editor at this page? https://facebook.github.io/draft-js/ i tried there as well as on the "What's on your mind?" editor on Facebook and wasn't able to repro the behavior (though my Mac OSX was 10.12 and Chrome version 54). do you have any browser extensions? |
Hi @davidchang I'm able to reproduce on that page as well. I can also try on some other browsers as well. I'll let you know what I see. |
Here are some preliminary testing results Reproducible Not Reproducible |
The Windows 10 IE 11 and WPF Web Browser Control issues are due to #917. |
…archive#667" This fixes some issues with the fix originally merged from PR facebookarchive#667[2] Credit to @balpert and @srmcconomy for this fix. For now I'm getting them back in sync. Also thanks to @davidchang for pinging me about landing this, @colinjeane for reporting this bug in facebookarchive#917 and submitting a nearly identical fix: facebookarchive#919 @colinjeane since we already had this fixed internally I'm going to use our approach to keep things in sync. fixes facebookarchive#917, facebookarchive#849 [2]: facebookarchive#667 We also had to tweak this compared to the current internal version to accomodate a recent change that makes 'editOnBeforeInput' and the other handlers take 'editor' as an explicit argument instead of assumming 'this' will be the editor; facebookarchive@e64c2c3 Note that we are updating the version of 'fbjs' required in order to get access to the 'setImmediate' polyfill.
) This fixes some issues with the fix originally merged from PR #667[2] Credit to @balpert and @srmcconomy for this fix. For now I'm getting them back in sync. Also thanks to @davidchang for pinging me about landing this, @colinjeane for reporting this bug in #917 and submitting a nearly identical fix: #919 @colinjeane since we already had this fixed internally I'm going to use our approach to keep things in sync. fixes #917, #849 [2]: #667 We also had to tweak this compared to the current internal version to accomodate a recent change that makes 'editOnBeforeInput' and the other handlers take 'editor' as an explicit argument instead of assumming 'this' will be the editor; e64c2c3 Note that we are updating the version of 'fbjs' required in order to get access to the 'setImmediate' polyfill.
…archive#667" (facebookarchive#871) This fixes some issues with the fix originally merged from PR facebookarchive#667[2] Credit to @balpert and @srmcconomy for this fix. For now I'm getting them back in sync. Also thanks to @davidchang for pinging me about landing this, @colinjeane for reporting this bug in facebookarchive#917 and submitting a nearly identical fix: facebookarchive#919 @colinjeane since we already had this fixed internally I'm going to use our approach to keep things in sync. fixes facebookarchive#917, facebookarchive#849 [2]: facebookarchive#667 We also had to tweak this compared to the current internal version to accomodate a recent change that makes 'editOnBeforeInput' and the other handlers take 'editor' as an explicit argument instead of assumming 'this' will be the editor; facebookarchive@e64c2c3 Note that we are updating the version of 'fbjs' required in order to get access to the 'setImmediate' polyfill.
) This fixes some issues with the fix originally merged from PR #667[2] Credit to @balpert and @srmcconomy for this fix. For now I'm getting them back in sync. Also thanks to @davidchang for pinging me about landing this, @colinjeane for reporting this bug in #917 and submitting a nearly identical fix: #919 @colinjeane since we already had this fixed internally I'm going to use our approach to keep things in sync. fixes #917, #849 [2]: #667 We also had to tweak this compared to the current internal version to accomodate a recent change that makes 'editOnBeforeInput' and the other handlers take 'editor' as an explicit argument instead of assumming 'this' will be the editor; e64c2c3 Note that we are updating the version of 'fbjs' required in order to get access to the 'setImmediate' polyfill.
…archive#667" (facebookarchive#871) This fixes some issues with the fix originally merged from PR facebookarchive#667[2] Credit to @balpert and @srmcconomy for this fix. For now I'm getting them back in sync. Also thanks to @davidchang for pinging me about landing this, @colinjeane for reporting this bug in facebookarchive#917 and submitting a nearly identical fix: facebookarchive#919 @colinjeane since we already had this fixed internally I'm going to use our approach to keep things in sync. fixes facebookarchive#917, facebookarchive#849 [2]: facebookarchive#667 We also had to tweak this compared to the current internal version to accomodate a recent change that makes 'editOnBeforeInput' and the other handlers take 'editor' as an explicit argument instead of assumming 'this' will be the editor; facebookarchive@e64c2c3 Note that we are updating the version of 'fbjs' required in order to get access to the 'setImmediate' polyfill.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Highlighting text then deleting it deletes text at the previous selection state instead of the current selection.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started:
1a. Take note of the current cursor position
Expected Results:
Text under the highlighting is deleted
Actual Results:
Text at the previous selection is deleted
This issue is reproducible on facebook.com's "What's on your mind?" editor.
What is the expected behavior?
Highlighted text should be deleted
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
Experiencing this on Mac OSX 10.11.6 Chrome Version 55.0.2883.75 beta (64-bit). Have customers who have reported seeing it on Windows 7 Browser Control (pretty much a hacky version of IE) as well.
Unsure if this worked in previous versions of draft. We are using draft-js 0.9.1.
The text was updated successfully, but these errors were encountered: