Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110402

Line break characters in TextInput break visuals of text selection

    XMLWordPrintable

Details

    • All

    Description

      When TextInput contains "\n" new line character, text selection breaks.

      For example, try to paste this — with or without quotes, I just had to add "" here because thanks to Jira markup — in TextInput or TextField, and select part of the word:

      "
      симпатия"
      

      A little explanation to the screenshot:

      The "\n" character was accidentally prepended by a dictionary software. It breaks text selection by shifting rest of the characters to the right. Actually, both TextInput and Field share this bug (but not QtWidgets LineEdit), but I deleted "\n" from TextInput just to show how it "should" look like

      The more "\n" characters you have in there, the more rest of the text will be shifted to the right after start of selection.

      Minimal reproducible example in QML:

      import QtQuick.Controls 2.15
      TextField {
          text: "\nabc"
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ratijas ivan tkachenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes