简体   繁体   中英

Flex TextInput Left Click - Parent Steals Focus

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM