Announcement

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

    Issue with "over" style being applied to selected TreeGrid node when TreeGrid loses focus.

    Hi Isomorphic,

    You can use the following showcase example to reproduce this issue:

    https://www.smartclient.com/smartgwt...abinding_local

    If you select a node in the tree, it appears to be applying the rollover style to the selected record once you move the mouse out of the tree grid in certain cases.

    The following image shows what happens when you select a node and then move the mouse vertically to the top of the page. Notice that the selected node has the rollover style applied.

    Click image for larger version

Name:	smartgwt_selected_over_rollover.jpg
Views:	120
Size:	10.5 KB
ID:	266756
    The next image shows what happens if you move the mouse to the bottom of the page. Notice that the selected node does not have the rollover style.

    Click image for larger version

Name:	smartgwt_selected_over_norollover.jpg
Views:	83
Size:	10.7 KB
ID:	266757

    Is there a way to prevent this?

    Thanks in advance.

    #2
    Hi Isomorphic,

    Have you had a chance to review this?

    In my case, the selected style is disabled for the tree grid with tree.setShowSelectedStyle(Boolean.FALSE) so I don't expect to see a selected node, however, the last node that was clicked on will receive the over style after the mouse exits (in certain directions) the tree grid making it look like it was selected.

    Thanks

    Comment


      #3
      Hi
      We are reproducing the issue but don't have a fix yet. A developer is investigating and we'll follow up as soon as we have more information for you

      Regards
      Isomorphic Software

      Comment


        #4
        Hi Again
        The reason for the "over" styling showing up on mouseOut is actually to indicate the keyboard focus row. This is helpful as a visual cue to users indicating which row currently has keyboard focus so if they hit an arrow key they know where they'll be moving from/to. This is particularly valuable if there are currently multiple selected rows, or the user is navigating without selecting (due to a specified arrowKeyAction, or holding down the Ctrl key while hitting arrow keys, etc).

        The fact that it isn't updated when you roll off the bottom of a grid is a bug - the logic to update the row was only firing if the user was over a row and then rolled out of the widget - not if they were over the empty space below a grid's last record, and then out of the widget.

        We've fixed the bug - this over styling will now show up reliably on mouseOut - and we've added support for a flag to turn this behavior off.
        Nightly builds dated Nov 12 or above will include a new attribute on ListGrid "preserveFocusStylingOnMouseOut". If you call setPreserveFocusStylingOnMouseOut(false) you should get the behavior you're after.

        Note that we consider this an advanced property. The fact that you're disabling selected styling implies you may be doing something sophisticated here where disabling this feature is appropriate, but we definitely recommend that if you're turning it off you consider whether this would introduce any accessibility concerns for users relying on an obvious visual highlight during keyboard navigation.

        Regards
        Isomorphic Software
        Last edited by Isomorphic; 15 Nov 2021, 11:06.

        Comment


          #5
          Hi Isomorphic ,

          Thanks for adding the flag.

          I have pop-up panel with an embedded ListGrid (previously a TreeGrid). The panel is used like a menu and is dismissed when clicking on a record in the ListGrid. The problem was that the list would preserve the focus for the previous selected record when popping up the panel again. Calling setPreserveFocusStylingOnMountOut(false), gives me the behavior I was looking for.

          Out of curiosity, does the Menu class do something similar to clear the focus when it is dismissed? Or is there some other mechanism for this.

          Thanks

          Comment

          Working...
          X