File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed
Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -1285,8 +1285,10 @@ export function DashAgGrid(props) {
12851285
12861286 useEffect ( ( ) => {
12871287 // Apply selections
1288- setSelection ( props . selectedRows ) ;
1289- } , [ props . selectedRows ] ) ;
1288+ if ( gridApi ) {
1289+ setSelection ( props . selectedRows ) ;
1290+ }
1291+ } , [ props . selectedRows , gridApi ] ) ;
12901292
12911293 // 1. Handle gridApi initialization - basic setup
12921294 useEffect ( ( ) => {
@@ -1479,27 +1481,6 @@ export function DashAgGrid(props) {
14791481 props . detailCellRendererParams ,
14801482 ] ) ;
14811483
1482- // 6. Handle selectedRows changes
1483- useEffect ( ( ) => {
1484- if (
1485- ! equals ( props . selectedRows , prevProps ?. selectedRows ) &&
1486- ! ( typeof props . loading_state !== 'undefined'
1487- ? props . loading_state && selectionEventFired . current
1488- : selectionEventFired . current )
1489- ) {
1490- if ( ! dataUpdates . current ) {
1491- setTimeout ( ( ) => {
1492- if ( ! dataUpdates . current ) {
1493- setSelection ( props . selectedRows ) ;
1494- }
1495- } , 10 ) ;
1496- }
1497- }
1498-
1499- // Reset selection event flag
1500- selectionEventFired . current = false ;
1501- } , [ props . selectedRows , props . loading_state ] ) ;
1502-
15031484 // 7. Handle dataUpdates reset
15041485 useEffect ( ( ) => {
15051486 dataUpdates . current = false ;
You can’t perform that action at this time.
0 commit comments