Insert (Ctrl + V) “CR LF” inside a word and then hit backspace. I guess what’s happening is that LF is removed but CR is still there breaking the input.
Instead of backspace you can try pressing left arrow, the first click will go back to previous line, next one will do nothing like it moved left of CR that’s treated as empty sign.
I guess better fix (mine just ignores CR when next char is LF) would be to remove CRLF together when using backspace or delete and jump over them when using arrows. #Edit Or not as there’s logic that converts single CRs to LFs when m_SoftKeyboard is used. Ignoring CRs and converting single ones to LF everywhere seems like simpler solution.
I could prevent from being appended to the text with the following simple change.
However, this would not prevent a from existing in the text being set on the input field. As such, when using left or right arrow (just like in the Unity Editor) the caret would stop on those hidden control characters. Ie. stop on and . Same when using Backspace or Del.
There are TMP users using in text objects to create text overwrite FX but does this make sense in an Input Field? Is anyone actually using in an input field?
In Microsoft Word, Notepad++, etc. are distinct characters but are treated as a single character when using in the sense that Backspace or Del will remove both.
[quote=“Stephan_B, post:5, topic: 847937, username:Stephan_B”]
There are TMP users using in text objects to create text overwrite FX but does this make sense in an Input Field? Is anyone actually using in an input field?
[/quote]I guess not as overwrite FX makes no sense there.
Your fix sounds better and simper. c == 10 is the same as c == ‘\n’?
I will actually address this differently as it is possible some users might be using .
The change I will make will continue to allow to be present in the text but just like MS Word or similar text editors treat as a single character, I will do so as well when using Backspace, Delete, Left and Right Arrow which these 2 characters will be treated as one when “Allow Rich Text Editing” is disabled.
Can you provide me with a simple repro project for me to look at? If more convenient, you can submit a bug report with project or provide me with a zip of the project via PM (in case you don’t want to share).
If you go the submit bug way, please provide me with the Case # once you have it.