Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] PlutoColumn renderer widget "unable to input" #112

Open
nsnans opened this issue Dec 9, 2024 · 3 comments
Open

[Bug] PlutoColumn renderer widget "unable to input" #112

nsnans opened this issue Dec 9, 2024 · 3 comments
Labels
bug Something isn't working stale

Comments

@nsnans
Copy link

nsnans commented Dec 9, 2024

Steps to reproduce the bug

  • Create a new project
  • Change main.dart
import 'package:flutter/material.dart';
import 'package:pluto_grid_plus/pluto_grid_plus.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

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.5, on Microsoft Windows [版本 10.0.22631.4037], locale zh-CN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.11.5)
[√] Android Studio (version 2024.2)
[√] IntelliJ IDEA Ultimate Edition (version 2024.1)
[√] VS Code (version 1.95.3)
[√] Connected device (3 available)

PlutoGrid version

  pluto_grid_plus:
    git:
      ref: 'c9ef81bb2afaa5b15f58b9af83b3bafc5f453082'
      url: 'https://github.com/doonfrs/pluto_grid_plus.git'

OS

Windows 11

@nsnans nsnans added the bug Something isn't working label Dec 9, 2024
@nsnans
Copy link
Author

nsnans commented Dec 9, 2024

  pluto_grid_plus:
    git:
      ref: 'c9ef81bb2afaa5b15f58b9af83b3bafc5f453082'
      url: 'https://github.com/doonfrs/pluto_grid_plus.git'

This is the last submission record.

image

@marcosgcd
Copy link

The issue is how keyEvents are handled. For a quick fix I removed the FocusScope widget and will implement my own Keyboard navigation

Bildschirmfoto 2024-12-11 um 02 48 16

Copy link

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

@github-actions github-actions bot added the stale label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants