This is an automated email from the ASF dual-hosted git repository.

hugoferreira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3168243579 Fix VirtualDataGrid column misalignment when window regains 
focus
3168243579 is described below

commit 31682435794a401ef6e450ff74b42298f5be7bae
Author: Hugo Ferreira <[email protected]>
AuthorDate: Tue Apr 7 12:04:25 2026 +0100

    Fix VirtualDataGrid column misalignment when window regains focus
    
    Remove dependency on isAreaFocus flag for column synchronization.
    
    Previously, if the browser window regained focus without a mouseover event
    (e.g., switching monitors, clicking another window), the isAreaFocus flag
    would remain false, preventing the scrolling column from syncing to its 
siblings.
    
    Now any scroll event on any column triggers synchronization to all others,
    regardless of mouse position. The _syncingDataGrid flag still prevents loops
    during programmatic scrollTop changes.
    
    Fixes column misalignment in multi-monitor and side-by-side window 
scenarios.
---
 .../beads/layouts/VirtualDataGridListAreaLayout.as    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VirtualDataGridListAreaLayout.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VirtualDataGridListAreaLayout.as
index 751b2eb060..a0f4c2bf13 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VirtualDataGridListAreaLayout.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VirtualDataGridListAreaLayout.as
@@ -98,24 +98,25 @@ package org.apache.royale.jewel.beads.layouts
 
         override protected function scrollHandler(e:Event):void
         {
-            if (!isAreaFocus)
+            // Check if we're being synced by another column's scroll handler
+            COMPILE::JS
             {
-                // Non-focused column: skip layout() if the focused column 
already synced us
-                // and called layout() directly — avoids a redundant call 
before the browser paints.
-                COMPILE::JS
+                if (_syncingDataGrid != null && _syncingDataGrid == (host as 
IDataGridColumnList).datagrid)
                 {
-                    if (_syncingDataGrid != null && _syncingDataGrid == (host 
as IDataGridColumnList).datagrid)
-                        return;
+                    // Being synced - just update layout without syncing others
+                    super.scrollHandler(e);
+                    return;
                 }
-                super.scrollHandler(e);
-                return;
             }
 
-            // Focused column: update its own layout first.
+            // Update own layout
             super.scrollHandler(e);
 
             COMPILE::JS
             {
+                // Any scroll event on this column triggers sync to all others,
+                // regardless of mouse position. This handles cases where the 
browser
+                // window regains focus without a mouseover event.
                 var myDataGrid:IDataGrid = (host as 
IDataGridColumnList).datagrid;
                 _syncingDataGrid = myDataGrid;
 

Reply via email to