Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-27176

MouseEvents act differently in a custom skinned ButtonBarButton when an icon is present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK 4.5 (Release)
    • Adobe Flex SDK Next
    • Spark: TabBar
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows 7
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a TabBar with a custon ButtunBarButton skin that has no MouseEvent handlers declared in the skin
      2. Create a function with the'dataGroupItemRendererFunction(item : Object) : IFactory' signature and assign it as a DataGroup's itemRendererFunction
      3. Run an application with the TabBar having at least 1 tab created

      Actual Results:
      Mousing over the background portion of the skin does not change the button's state, yet mousing over the label does

      Expected Results:
      Mouse behavior should work normally

      Workaround (if any):
      1. In the skin definition add mouseOver = "{}"
      2. Re-run the application and find that mousing over the skin background now causes state changes

      Per the forum post here:
      https://prerelease.adobe.com/project/forum/thread.html?cap=b4dd6eba22d848afbd7e0c95bd5eae0c&forid=

      {E8AB0CF6-3479-4F80-96EB-C54C8C3C3919}

      &topid=

      {BF7AF586-833A-4E73-9523-298B48DE54E9}

      With text:
      I was skinning the TabBar recently and ended up using the itemRendererFunction for the "dataGroup" SkinPart in a modified version of the TabBarSkin. The function returns one of two ClassFactory objects based on the data, one of these produces a ButtonBarButton. This ButtonBarButton is skinned in my CSS with a modified version of the TabBarButtonSkin.

      I noticed that no mouse events are dispatched from the skin, but the label and icon would dispatch events. This meant that state changes were not being triggered until the label/icon were interacted with. I tested out the problem by adding a mouseOver="trace('hello world')" to the modifed TabBarButtonSkin. Strangely the trace message was not output, but now the states were changing correctly!

      Digging into the classes I see that the GroupBase component has a property 'hasMouseListeners' that gets set to true when any mouse or touch event listener is added to the DataGroup or one of it's renderer's. It appears that when a renderer is generated via the default DataGroup 'itemRenderer' property the 'hasMouseListeners' property is set. When the renderer is generated via the itemRendererFunction & a ClassFactory the 'hasMouseListeners' property is not set. This means that mouse interaction with the DataGroup renderer's does not get handled correctly.

      The issue can be mitigated by attaching an arbitrary mouse event listener to the TabBarButtonSkin, but the underlying problem still remains...

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: