0 Replies Latest reply on Feb 27, 2008 1:17 AM by RAHSKAR_II

    Focus Manager confused because of event.stopPropagation() in parent?

    RAHSKAR_II
      Hi!

      I'm experiencing a problem with the focus manager and wrong set focusses!

      When using the Rich Text Editor-control after changing any of the textstyles by clicking one of the buttons the focus is (should be) set back to the textarea of the RichTextEditor (via callLater(textArea.setFocus)).

      But when I implement an event-listener listening to "MOUSE_DOWN"-events in the parent of the Rich Text Editor like this:

      addEventListener(MouseEvent.MOUSE_DOWN,
      function(e:MouseEvent):void
      {
      e.stopPropagation();
      });

      the focus is not set correctly back to the textArea.

      I can determine that the focus is not taken away from the textArea during mouse-down when clicking one of the style buttons bold/italic/underlined and that the focus jumps to the align-buttons (left, right, center) when clicking one of them. Furthermore if you open and close the color-picker-control the focus jumps to a place of the Rich Text Editor where even no control object is present having the size of the color-picker button!


      If I comment this line out

      e.stopPropagation();

      everything is working fine.


      For safety purposes and to prevent side-effects of superordinated objects I would like to block all events at a certain point. Or is this no good idea in general?

      note: This only happens when blocking MOUSE_DOWN-events. I did not experience failures when blocking one of the other mouse-events.

      Thanks in advance!
      Maik