Browse Source

Remove all CR characters when inserting text in TextField.

tags/v2.6.1
Andrew Belt 2 months ago
parent
commit
414f7bec9b
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/ui/TextField.cpp

+ 3
- 0
src/ui/TextField.cpp View File

@@ -325,6 +325,9 @@ std::string TextField::getSelectedText() {
} }


void TextField::insertText(std::string text) { void TextField::insertText(std::string text) {
// Rack uses UNIX newlines so remove all CR characters
text.erase(std::remove(text.begin(), text.end(), '\r'), text.end());

bool changed = false; bool changed = false;
if (cursor != selection) { if (cursor != selection) {
// Delete selected text // Delete selected text


Loading…
Cancel
Save