opengisch / QField

A simplified touch optimized interface for QGIS
http://www.qfield.org
GNU General Public License v2.0
843 stars 229 forks source link

Missing focus for text edit widgets #2269

Open lp-dj opened 3 years ago

lp-dj commented 3 years ago

It can be quite fiddly to compose a somewhat longer text in a text field, since for one thing the focus on the cursor is not held and the cursor can hardly be relocated by a finger tap.

Reproduction Steps:

  1. Open an attribute form in edit mode that contains a text edit widget.
  2. Tap onto this text field and watch the text cursor and on-screen keyboard appear.
  3. Write a small text. 4a. Write more text until you have written more lines than the attribute form can show you at once. And / Or alternatively... 4b. Try to interact with the text edit widget using your finger, e.g. to move the cursor to another position or just to scroll the end of the text back into the visible area.

Expected behavior:

In 4a.: As soon as the text becomes longer than the maximum visible lines, I would expect the text or attribute form to scroll down automatically so that the cursor always stays in the visible area. In 4b.: You should be able to set the position of the cursor or scroll in the text with your finger during a "text editing session"*.

* That is, until you explicitly finish editing the text, e.g. via a "Done" button in the on-screen keyboard, as it also appears for number fields.

Observed behavior:

In 4a.: As soon as the text becomes longer than the number of visible lines, the cursor and thus the currently written lines disappear behind the on-screen keyboard. In 4b.: As soon as you try to interact with the text edit widget again (e.g. to realign the view), it loses focus and the on-screen keyboard disappears.

Screenshots and GIFs

Please let me know if my description was not understandable or clear enough, then I'll record an example video here.

QField version: 1.10.0 (1da006)]

Additional information:

BoswachterMarc commented 3 years ago

I experience the same behaviour in 2.0.8

nirvn commented 2 years ago

@lp-dj , can you provide a screencast here?

Preliminary conclusion: this is an upstream issue with Qt's QML, which we can't fix in QField itself.

lp-dj commented 2 years ago

Sure, of course @nirvn!

(Best thanks by the way for the feedback/ fixes on some of my other issues since yesterday!)

Here's the screencast:

I feel like the behavior has changed slightly since my description above. Or rather, I've also noticed that it varies in severity depending on the attribute form used. However, I can't see any systematics here yet.

https://user-images.githubusercontent.com/80956612/143837039-aa425590-e0e5-4084-a0e9-0ed95fcdfc4a.mp4

What you can see in the video:

The on-screen keyboard disappears when you try to move the cursor.

The text disappears behind the on-screen keyboard when it becomes too long.

No chance to scroll the end of the text into the visible area while typing. When trying, the whole QField interface flickers, even the map view distorts for a short time.

Regarding your theory about Qt's QML: is there any way I can find out which Qt version is currently being used? Does each app use its own Qt version or is it provided system wide?

I don't think the behavior was that bad in older QField versions (maybe 1.8?). But since then I think I also updated from Android 10 to 11. If it's a Qt issue and all apps use the same system-wide Qt installation, the behavior should be reproducible in other apps, right?

lp-dj commented 2 years ago

And what I'm just now noticing:

Look in the video at second 30 at the bottom of the attribute form. At this point, the field "Naturschutzfachlicher Hinweis" appears, which should be there all the time and not only when the text becomes long enough.

This is not always the case. I think this is because I had entered a longer text before the video recording and somehow QField did not reset the attribute form correctly after deleting the previous text?

nirvn commented 3 months ago

@lp-dj , it's been a while :) have things improved in that front after we updated to Qt 6.6?

lp-dj commented 2 months ago

@nirvn Sorry for the late reply. You caught me on vacation ;)

Unfortunately, I have not yet noticed any change/ improvement in this respect :-/