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

ColorPicker dropDown positioning logic problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 3.2 (Release)
    • mx: ColorPicker
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Internet Explorer 6.x
      Language Found: English

    Description

      I was recently writing my own dropDown-like component, using ColorPicker as the basis for some of the code. When, through testing, I found cases where my dropDown was being positioned incorrectly, I traced it back to code that I copied from ColorPicker. The problem code is where ColorPicker decides how to place the dropDown horizontally:

      // Position: left or right
      if (point.x + width + dropdownSwatch.width > screen.right &&
      point.x > (screen.left + dropdownSwatch.width))

      { // Dropdown appears to the left instead of right point.x -= (dropdownSwatch.width - width); }

      As I understand it, the code should left-align the dropDown with the picker itself, unless it extends too far to the right (and there's enough room to right-align it). If I'm correct, then the above if statement is wrong. It looks to see if there's space to put the dropDown fully to the left or right of the picker, which isn't what it actually does. It should be something like:

      if (point.x + dropdownSwatch.width > screen.right &&
      && point.x >= (dropdownSwatch.width - width))

      { // Dropdown appears to the left instead of right point.x -= (dropdownSwatch.width - width); }

      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: