Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8095956

[ListView] Regression: ListView auto-selecting first item on focusGained

    XMLWordPrintable

    Details

      Description

      probably introduced by fixing RT-25679

      As already noted in that issue, I disagree with both generality of the requirement and fix :-)

      - it's breaking behaviour big style
      - the requirement is not general enough to warrant a default: if applications need to select on focused, it's easy enough to in install custom listeners that force a selection
      - often, selection is bound to some action (like loading data from the backend) that might be costly to perform, doing so without need detoriates user experience
      - there's no way to keep the list unselected (which is a perfectly valid state) (except hacking: set the clientProperty "selectOnFocusGain" to Boolean.FALSE for ListView, nothing available for TableView, afaics)

      My suggestion:

      - revert to not break behaviour
      - if you really want to support it, support some per-instance/per-application configuration with not-auto-selecing on focusGained being the default. Something seems to be in-place already, there's an entry "selectOnFocusGain" in listView's properties map (since RT-36651 or RT-35679, can't see the latter - wondering why not?)

      it's a regression because it worked as expected (no auto-select) in 8u5

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jgiles Jonathan Giles
              Reporter:
              fastegal Jeanette Winzenburg
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: