syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.47k stars 693 forks source link

[Data Grid] ScrollController not attached error when replacing SfDataGrid with a different Widget #1914

Open mattmcquin opened 1 week ago

mattmcquin commented 1 week ago

Bug description

In my app, a user can toggle between a Grid View and a different custom view depending on certain settings. When they toggle away from the Syncfusion Grid View Widget, there is an error that occurs: "ScrollController not attached to any scroll views."

Important note: This ONLY happens when allowColumnsResizing is set to true.

Steps to reproduce

  1. Create toggle between a non-SfDataGrid Widget and a SfDataGrid with allowColumnsResizing set to true
  2. Toggle off of the SfDataGrid Widget and see the error in console

Code sample

Code sample ```dart [Add your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Stack Traces

Stack Traces ```dart ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════ The following assertion was thrown during a scheduler callback: Assertion failed: file:///opt/homebrew/Caskroom/flutter/3.10.5/flutter/packages/flutter/lib/src/widgets/scroll_controller.dart:157:12 _positions.isNotEmpty "ScrollController not attached to any scroll views." When the exception was thrown, this was the stack: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3 throw_ dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 38:3 assertFailed packages/flutter/src/widgets/scroll_controller.dart 157:23 get position packages/flutter/src/widgets/scroll_controller.dart 165:33 get offset packages/syncfusion_flutter_datagrid/src/datagrid_widget/runtime/column.dart 1651:46 getXPosition packages/syncfusion_flutter_datagrid/src/datagrid_widget/runtime/column.dart 1357:12 [_getHitTestResult] packages/syncfusion_flutter_datagrid/src/datagrid_widget/runtime/column.dart 1874:71 [_ensureCursorVisibility] packages/syncfusion_flutter_datagrid/src/datagrid_widget/runtime/column.dart 1840:5 onPointerExit packages/syncfusion_flutter_datagrid/src/datagrid_widget/widgets/rendering_widget.dart 1523:28 [_onPointerExit] packages/flutter/src/rendering/mouse_tracker.dart 411:28 dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:7 forEach packages/flutter/src/rendering/mouse_tracker.dart 409:20 _handleDeviceUpdateMouseEvents packages/flutter/src/rendering/mouse_tracker.dart 277:5 [_handleDeviceUpdate] packages/flutter/src/rendering/mouse_tracker.dart 373:9 packages/flutter/src/rendering/mouse_tracker.dart 205:5 [_deviceUpdatePhase] packages/flutter/src/rendering/mouse_tracker.dart 367:5 updateAllDevices packages/flutter/src/rendering/binding.dart 465:7 packages/flutter/src/scheduler/binding.dart 1386:7 [_invokeFrameCallback] packages/flutter/src/scheduler/binding.dart 1322:11 handleDrawFrame packages/flutter/src/scheduler/binding.dart 1169:5 [_handleDrawFrame] lib/_engine/engine/platform_dispatcher.dart 1346:5 invoke lib/_engine/engine/platform_dispatcher.dart 260:5 invokeOnDrawFrame lib/_engine/engine/initialization.dart 185:36 dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 550:37 _checkAndCall dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 555:39 dcall ```

On which target platforms have you observed this bug?

Web

Flutter Doctor output

Doctor output ```console [Add your output here] ```
abineshPalanisamy commented 1 week ago

Hi @mattmcquin ,

We have checked your query at our end. We have considered this as a bug and logged a bug report regarding this in our feedback portal. We will fix the reported issue and include the changes in our upcoming weekly patch release, which is expected to be rolled out on July 02, 2024. We will let you know once released, and we appreciate your patience until then.

Regards, Abinesh P