[textarea] TextArea focus is not handled correctly

Bug #1163371 reported by Ugo Riboni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Critical
Zsombor Egri
ubuntu-ui-toolkit (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Refer to the attached example, running on a phone.

(1) touch the red button: the top text field is focused and the OSK comes up
(2) touch the green button: the bottom text field is focused but the OSK doesn't come up

What should happen is obviously that at step (2) the OSK comes up.

The problem is that somehow focus is not proxied correctly inside of the TextArea or the OSK is not invoked correctly when the inner text component received activeFocus.

Related branches

Revision history for this message
Ugo Riboni (uriboni) wrote :
Changed in ubuntu-ui-toolkit:
assignee: nobody → Zsombor Egri (zsombi)
importance: Undecided → High
status: New → Confirmed
Changed in ubuntu-ui-toolkit:
importance: High → Critical
Revision history for this message
Zsombor Egri (zsombi) wrote :

The problem is that when (2) is executed, setting focus on t2 removes focus from t1, resulting in removing OSK. This removal is happening because we remove the OSK explicitly when focus is lost (TextArea lines 923->930). In order to control that, we need to expose a property which drives the automatic OSK removal upon focus loss.

Revision history for this message
Zsombor Egri (zsombi) wrote :

Being more precise, t2 focus is set earlier that it is removed from t1, therefore OSK gets hidden.

Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit:
status: Confirmed → In Progress
Revision history for this message
Florian Boucault (fboucault) wrote :

The root cause of the issue is that removing activeFocus from a TextInput does not hide the OSK on Ubuntu Touch. That is the reason for the hiding of the OSK being handled manually in TextArea line 923.

Revision history for this message
Florian Boucault (fboucault) wrote :

To confirm the previous comment, here is an extract from the QInputMethod::hide() documentation:
"Normally applications should not need to call this function, keyboard should automatically close when the text editor loses focus, for example when the parent view is closed."

http://qt-project.org/doc/qt-5.0/qtgui/qinputmethod.html#hide

Looking at the code of TextInput, there is no call to hide() at any point, only calls to show().

Revision history for this message
Florian Boucault (fboucault) wrote :

So, we need a bug report against Qt, ideally with a fix and a unit test against Qt :)

In the meantime we should:
1. report the bug against Qt
2. refer to that bug report to justify the manual handling of the input method visibility in TextArea and TextField
3. add (failing) unit tests in the toolkit that illustrate the bug of the keyboard not showing for both TextArea and TextField
4. add a workaround to fix these failing unit tests. Inspiration: add the following in both TextArea and TextField http://pastebin.ubuntu.com/5715804/

Ugo Riboni (uriboni)
description: updated
Revision history for this message
Zsombor Egri (zsombi) wrote :
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-ui-toolkit at revision None, scheduled for release in ubuntu-ui-toolkit, milestone Unknown

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-ui-toolkit - 0.1.43

---------------
ubuntu-ui-toolkit (0.1.43) raring; urgency=low

  * Fix for text inputs staying disabled after being re-enabled. The previous
    workaround for removing input panel was blocking re-enabling a
    previously enabled input. (LP: #1164634)
  * Fixing disabled text input delegate background color theming when userValue
    is set to TextField or TextArea color property. (LP: #1169601)
  * Workaround for TextArea and TextField removing OSK when active focus is
    transferred from one instance to another using focus property (LP: #1163371)
  * Fix for TextArea Enter/Return keys being stolen when embedded in
    ListItems.Empty. (LP: #1166840)

ubuntu-ui-toolkit (0.1.42) raring; urgency=low

  [ Loïc Minier ]
  * Drop ubuntu-sdk package; now generated from sdk ubuntu-touch seed in
    ubuntu-touch-meta package.

  [ Timo Jyrinki ]
  * Sync with raring packaging, separate meta also in the PPA again
  * New upstream snapshot
    - Update documentation html styles
    - Fix the clamping of sheet width on narrow screens.
    - Added "make license" target
    - Added online and offline API documentation configurations, both with
      Ubuntu styling.

  [ Tim Peeters ]
  * Rewrite of theming engine. See CHANGES for details and deprecated APIs.

ubuntu-ui-toolkit (0.1.41) raring; urgency=low

  * Update documentation html styles
  * Automatic license checking for source files
  * Fix clamping bug for sheets on narrow screens

ubuntu-ui-toolkit (0.1.40) raring; urgency=low

  * Improve header and toolbar documentation for MainView/Page/PageStack/Tabs.
  * Fix bug in header (hide it when the header is empty)

ubuntu-ui-toolkit (0.1.39) quantal; urgency=low

  * New Icon component that displays icons from the icon theme.
  * Added libqt5svg5 as a dependency thus allowing use of SVGs in icon themes.
  * Fix bug in list items.
 -- Ken VanDine <email address hidden> Thu, 18 Apr 2013 10:18:52 -0400

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.