July 10, 2012

Reptile Reptile
Lab Rat
28 posts

Fickable + TextField + InputContext

 

Anyone have any idea how to force scroll the Flickable to a specific child if the Flickable is resized due to the inputContext’s visibility?

ETA:

So each TextField has a function like so:

  1. TextField {
  2.    ...
  3.    onActiveFocusChanged: if (activeFocus) Flick.ScrollTo(textfieldid)
  4. }

In the Flick.js
  1. function scrollTo(child) {
  2.    
  3.    flickable.contentY = child.y + child.height - flickable.height;
  4.  
  5. }

Here’s where I run into some problems. When the contentY changes, the flickable seems to steal focus. When that happens, the inputContext is no longer visible (the vkb goes away). After the inputContext goes into hiding, the flickable resizes back to normal (it’s anchored to the top of the inputContext’s item). Is there a way to have the TextField maintain focus while the flickable scrolls? Or am I looking at the problem the wrong way?

[Edit: Please wrap code in @ tags. Thanks — mlong]

1 reply

July 11, 2012

Reptile Reptile
Lab Rat
28 posts

Updated. Has anyone done something similar?

 
  ‹‹ XMLHttpRequest troubles      [SOLVED] AnchorChanges strange effect ››

You must log in to post a reply. Not a member yet? Register here!