Pasting Rich Text Into Chrome & Firefox on Windows Adds A Space On Either Side
See original GitHub issueWhen pasting rich text into Chrome it adds a space on either side of the string (first screenshot). When pasting in any other browser (Safari or Firefox) it behaves fine (second screenshot). It seems that Chrome is using the HTML text and the others are using plain text.
Is there a way to get Chrome to trim the string on paste? Tried using handlePastedText
but I’m not sure how to update the state on firing.
Chrome:
Safari:
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:21 (2 by maintainers)
Top Results From Across the Web
Firefox copy feature always adds extra space before or after ...
The problem is that when I paste, Firefox pastes improperly formatted rich text. My work around is to paste into text editor and...
Read more >Extra space appended after pasting a value when it ends in a ...
Opera appends two spaces in both the address-bar as input fields. Safari adds one space in both, Chrome adds no spaces in the...
Read more >Copy-Pasted Text Has Random Extra Spaces...? : r/firefox
If you are copying from a browser page, those may well be non-breaking spaces (Unicode U+00A0; UTF-8 0xA0). Copy your text into a...
Read more >New features available with macOS Ventura. - Apple
Brings together all the information you're looking for in one rich result. ... other apps and windows are arranged on the left side...
Read more >Is there a way to copy text from a web page without its ... - Quora
You can copy text from right click disable page. It's very simple and easy. #1. Use Mozilla Firefox or Google Chrome Browser. #2....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
not sure why this would happen, but this code should work to trim the trailing whitespace assuming your change handler is called
onChange
:ES6 class members aren’t auto-bound like they are in
React.createClass
, implementing members as arrow functions solves this problem: