Bug 12347

Summary: When chat overlay extends, text entry should gain focus
Product: [Extras] Miniature Reporter: Michael Hasselmann <michael>
Component: UIAssignee: Uwe Kaminski <jukey>
Status: CLOSED FIXED QA Contact: general
Severity: enhancement    
Priority: High CC: jukey, quimgil
Version: masterKeywords: easyfix
Target Milestone: 0.4   
Hardware: All   
OS: All   
Attachments: 90% Implementation of "gain focus" functionality if chat extends (works only with special requirements)

Description Michael Hasselmann (reporter) 2011-08-25 22:26:37 UTC
SOFTWARE VERSION:
0.3 (N950) 

EXACT STEPS LEADING TO PROBLEM:
1. Open chess board,
2. Tap on chat area.

EXPECTED OUTCOME:
Text entry should be focused and virtual keyboard should come up (if required).

ACTUAL OUTCOME:
Nothing, user needs to focus manually.
Comment 1 Quim Gil 2011-08-26 18:48:09 UTC
Agreed, although we need to see this working in a real chat. Many taps might
come only because the user wants to read more, not type. If that is the case
then the keyboard eats chat area. But why not, there is still plenty left. 

In any case the change is simple and it looks like a good task for a new
contributor.
Comment 2 Uwe Kaminski 2011-08-31 01:37:42 UTC
Created an attachment (id=3409) [details]
90% Implementation of "gain focus" functionality if chat extends (works only
with special requirements)

This patch contains the attribute (Is this the correct word?) "focus: true"
which is enabled if the chat area extends. The problem:

Steps to reproduce:
1. Run Miniature and enter a game
2. Tap onto the Chat area --> Chat area expands but chatField is getting no
focus
3. Tap into the chatField

Outcome: Nothing happens - this is a big issue!

4. Tap and hold into the chatField ...keep your finger touched on the screen
5. Swipe a little bit up and down your finger

Outcome: The chatField is getting focus and will appear as expected between
step 3. and 4.

6. Tap into the chat area above the input field --> The extended chat area
dissapears
7. Tap onto the small chat area as done in step 2

Outcome: Chat area expands but chatField _is getting focus_

Now you can repeat step 6. to 7. as often as you want. Every time gain focus
works as expected.

Does somebody have an idea what's wrong? :)

PS: the second line of this patch:
placeholderText: "Enter text to chat"
is unreleated but usful to show what the chatField is for.
Comment 3 Quim Gil 2011-08-31 08:56:18 UTC
Looking at the documentation for TextField, "focus" doesn't appear in the list
of properties of the element or inherited.

It seems that the right way to do this is applying this method:


TextField::openSoftwareInputPanel ()
Opens software input panels like virtual keyboards for typing, useful for
customizing when you want the input keyboard to be shown and hidden in your
application.

Maybe useful if that alone doesn't work:

TextField::forceActiveFocus ()
Force active focus on the item. This method sets focus on the item and makes
sure that all the focus scopes higher in the object hierarchy are also given
focus.
Comment 4 Quim Gil 2011-09-13 22:31:17 UTC
Already implemented.
Comment 5 Uwe Kaminski 2011-09-14 09:17:01 UTC
Works as expected.