views:

450

answers:

2

Hi

I have having a problem in my flex/air application, in which when the left mouse button is clicked on a TextInput the focus is stolen by the parent.

So in more detail I have an hierarchy as follows...

accordion
   ->panel(Custom)
      ->TextInput
      ->TextInput

So some really annoying reason when I click on the TextInput's the focus goes to the accordion.

But when i add the same Custom Panel to a Canvas the TextInput works as per normal.

I don't understand why this would be happening?

A: 

Does your parent panel have a click effect that shifts focus? This could cause the issue because of event bubbling.

Edit: Could it be an issue with your custom panel? try taking the input text boxes out of the custom panel, putting them in a regular panel, and then putting that into the accordian...you probably won't have the issue still.

Zack
The the panel has no click events. What about the accordion does it do something by default?
James_Dude
Because if I remove the accordion it works like it should.
James_Dude
A: 

Can't reproduce the problem with this tiny example - it works correctly.

<mx:Accordion>
    <mx:Panel label="Test">
        <mx:TextInput />
        <mx:TextInput />
    </mx:Panel>
</mx:Accordion>

So, my suggestions would be:

  1. try removing any custom code you have in the accordion (event handler, etc)
  2. try using simple container instead of your custom and see if it still happens. If it doesn't then the problem is in your custom container.
Hrundik