← Back to team overview

touch-packages team mailing list archive

[Bug 1513897] Re: TextField regression/behavior change in 1.3

 

I spent some time debugging this, I'll leave my findings here:

Situation in 1.2
TextField has both 
"activeFocusOnPress: true" AND "property alias activeFocusOnPress: editor.activeFocusOnPress" (I don't know the reason behind the choice of having a property alias with the same name as the property coming from the C++ StyledItem)
and editor, which is a TextInput, has "activeFocusOnPress: true"

What happens in 1.2 when you tap on the button?
TextField doesn't get the focus, because its activeFocusOnPress is never set to true.
In fact, because of the alias declaration, setting "activeFocusOnPress: true" just enables the property of the editor, and doesn't actually change the property of the TextField (this is my guess after debugging the focus logic).
As a consequence, commenting out "activeFocusOnPress: true" in 1.2 TextField doesn't bring any behaviour change, because TextInput's activeFocusOnPress is true by default.

Situation in the current 1.3 (I'm testing on r1688)
The property alias was removed from TextField (this can be considered a fix). As a consequence,
"activeFocusOnPress: true" has the intended behaviour of setting the property of the TextField to true.

What happens in 1.3 when you tap on the button?
TextField gets the focus, because it has activeFocusOnPress set to true, so due to the way the current focus logic works, when the Button gets a mouse event, its parents get focus (if they requested it).
So even if UCAbstractButton has activeFocusOnPress set to false, its parent, TextField, still has it set to true, so it will get the focus whenever the Button receives a click.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-ui-toolkit in
Ubuntu.
https://bugs.launchpad.net/bugs/1513897

Title:
  TextField regression/behavior change in 1.3

Status in ubuntu-ui-toolkit package in Ubuntu:
  In Progress

Bug description:
  Having an AbstractButton as secondaryItem of a TextField used to not
  change the TextField focus status when pressing the button but with
  1.3 it does (i.e. the TextField used to not gain focus when pressing
  on secondaryItem and now it does)

  Code at http://paste.ubuntu.com/13125887/

  Is this an intended change or a behaviour regression?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1513897/+subscriptions


References