pluto_grid icon indicating copy to clipboard operation
pluto_grid copied to clipboard

[Bug] PlutoColumn renderer widget "unable to input"

Open nsnans opened this issue 1 year ago • 3 comments

Steps to reproduce the bug

  • Create a new project
  • Change main.dart
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PlutoGrid Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const PlutoGridExamplePage(),
      // home: Scaffold(
      //   body: TextField(
      //     onChanged: (value) {
      //       print(value);
      //     },
      //   ),
      // ),
    );
  }
}

class PlutoGridExamplePage extends StatefulWidget {
  const PlutoGridExamplePage({Key? key}) : super(key: key);

  @override
  State<PlutoGridExamplePage> createState() => _PlutoGridExamplePageState();
}

class _PlutoGridExamplePageState extends State<PlutoGridExamplePage> {
  final List<PlutoColumn> columns = <PlutoColumn>[
    PlutoColumn(
      title: 'Id',
      field: 'id',
      type: PlutoColumnType.number(),
      renderer: (rendererContext) {
        return TextField(
          onChanged: (value) {
            print(value);
          },
        );
      },
    ),
  ];

  final List<PlutoRow> rows = [
    PlutoRow(
      cells: {
        'id': PlutoCell(value: 'user1'),
      },
    ),
    PlutoRow(
      cells: {
        'id': PlutoCell(value: 'user2'),
      },
    ),
    PlutoRow(
      cells: {
        'id': PlutoCell(value: 'user3'),
      },
    ),
  ];

  late final PlutoGridStateManager stateManager;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        padding: const EdgeInsets.all(15),
        child: PlutoGrid(
          columns: columns,
          rows: rows,
          onLoaded: (PlutoGridOnLoadedEvent event) {
            stateManager = event.stateManager;
          },
          onChanged: (PlutoGridOnChangedEvent event) {
            print(event);
          },
          configuration: const PlutoGridConfiguration(),
        ),
      ),
    );
  }
}

Expected results

The TextField returned by the renderer can be modified

Actual results

The TextField returned by the renderer cannot be modified, but it can be focused

Code sample

See the steps to reproduce the bug

Execution Environment

Flutter version

[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [版本 10.0.22631.4037], locale zh-CN)
    • Flutter version 3.24.2 on channel stable at D:\flutter\FVM_HOME\versions\3.24.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (5 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at D:\AndroidSdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\JetBrains\JetbrainsToolbox\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.10.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Enterprise
    • Visual Studio Enterprise 2022 version 17.10.35201.131
    • Windows 10 SDK version 10.0.26100.0

[√] Android Studio (version 2024.1)
    • Android Studio at D:\JetBrains\JetbrainsToolbox\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] IntelliJ IDEA Ultimate Edition (version 2024.1)
    • IntelliJ at D:\JetBrains\JetbrainsToolbox\IntelliJ IDEA Ultimate
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.93.0)
    • VS Code at C:\Users\Toppine-DEV12\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.96.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22631.4037]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 128.0.6613.120
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 128.0.2739.63

[√] Network resources
    • All expected network resources are available.

• No issues found!

PlutoGrid version

8.0.0

OS

Windows 11

nsnans avatar Sep 09 '24 08:09 nsnans

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 09 '24 11:10 github-actions[bot]

Still no solution

nsnans avatar Oct 10 '24 01:10 nsnans

I have the same issue. Is PlutoGrid intercepting the input to detect enters and tabs (grid navigation) etc? I can actually input values if I start with a ^

grillbiff avatar Oct 17 '24 12:10 grillbiff

I have the same issue. Is PlutoGrid intercepting the input to detect enters and tabs (grid navigation) etc? I can actually input values if I start with a ^

If it is running on a mobile phone, you can enter. However, I tested it on web and Windows and couldn't type it. Not sure what the problem is.

Still no solution.

nsnans avatar Nov 05 '24 02:11 nsnans

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Dec 05 '24 11:12 github-actions[bot]

@nsnans I would looking at https://github.com/doonfrs/pluto_grid_plus for a maintained pluto_grid_version If it still happens: please create this issue in pluto_grid_plus. and tag me i will create the feature for you.

stan-at-work avatar Dec 07 '24 14:12 stan-at-work

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jan 07 '25 11:01 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jan 23 '25 11:01 github-actions[bot]