Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    12.1/13.0/13.1 ListGrid headerAutoFit doubleClick also sorts

    Hi Isomorphic,

    playing with this sample (SNAPSHOT_v13.1d_2024-09-06) and adding
    autoFitWidthApproach: "both"
    headerAutoFitEvent: "doubleClick" (just to be sure)

    I noticed that the gird always also sorts when I double click.

    The docs mention this only for headerAutoFitEvent:"click", so I assume this behavior is not wanted.

    Also happens in 12.1/13.0 ListGrids.

    Best regards
    Blama

    #2
    It's always tricky when a single click and a double click cause different results (sort and autoFit-without-sort in this case): in order to avoid triggering the single click behavior if there is a double-click, our software would have to wait until the double click delay expires. That's typically 300-500ms.

    But then, humans only perceive a reaction as "immediate" if the results happen within 100ms. This is a bedrock HCI principle.

    So if single- and double-click do totally different things, and a double click should not trigger the single click action, then the single click action necessarily "feels slow", and this is a human behavior, not something we can fix with software.

    For this reason, from a UE perspective, you want the double-click behavior to be the same as the single-click behavior plus something more. Then that single-click response can be immediate, and if the end user clicks a second time, you also do the double-click behavior. An everyday example is that single-click selects and then double-click selects but also takes some additional action (like starting editing).

    So, the framework does allow you to define clashing behaviors for click and doubleClick - we can't in general detect that you have done so, since you can write your own event handlers!

    But if you really want to violate UE principles, you've got to implement it manually: turn off the framework's support for the single-click behavior, set a timer when click occurs to wait for the double-click delay, and then perform the single-click action only if a double-click has not occurred.

    Just to emphasize again: that's bad UE. We're just explaining how to implement it if, for whatever reason, project requirements are forcing you to implement bad UE (it happens!).


    Comment


      #3
      Hi Isomorphic,

      OK, no problem. To be honest I never noticed this as a problem myself. It is just that the headerAutoFitEvent docs make it sound like the current behavior is a bug, which I wanted to point out.
      Note that if sorting is enabled for the field and the headerAutoFitEvent is "click", both sorting and autofit occur on a click.
      Perhaps revise or remove the sentence or put the advice from #2 on how to avoid both actions in the docs.

      Best regards
      Blama

      Comment

      Working...
      X