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

TextField clipping input text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.12.5
    • Quick: Controls 2
    • None
    • Android 5-9, Linux Ubuntu 17.10
    • Android, Linux/Other display system

      I've encountered this issue on Androic systems across versions 5-9 and reproduced in linux as Desktop qt.
      Placeholder text seems to be correctly aligned vertically, inputted text, however isn't.
      Setting `verticalAlignment` property does not have any effect on typed text.
      Minimal example: (Ubuntu 17.10)
      import QtQuick 2.12import QtQuick.Window 2.12import QtQuick.Controls 2.4

       

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.4
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          TextField {
              height: 20
              width: 200
              placeholderText: "Test text"
              background: Rectangle {
                  radius: 3
                  color: "gray"
              }
          }
      }
      

       

      placeholder text:

       

      when the text is inputted (it is raised and clipped at the top)

       

      Note that this issue only occurs when the height of the TextField is exactly or slightly larger than the height of the text font. It seems to me that there is a inner padding that has an effect of raising the text and clipping it at the top.
      By setting the textField's height above 28 in my example, made the TextField tall enough so the issue is masked.
      Let me know if more info is needed.  

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            rtusek Roman Tušek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes