bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.
https://bdlukaa.github.io/fluent_ui/
BSD 3-Clause "New" or "Revised" License
2.95k stars 463 forks source link

🐛 TextBox is unfocussable #1083

Open M-Ahal opened 3 months ago

M-Ahal commented 3 months ago

Describe the bug The TextBox() widget does not focus on tap, and also is non-editable because of it. The Flutter-Inspector, shows it's FocusNode as 'NOT FOCUSABLE'

To Reproduce Minimal Reproducible example

  1. Create a new Flutter project with windows as a platform
  2. Use fluent_ui: ^4.9.0 as a dependency
  3. Overwrite main.dart with the attachment (main.txt because of Github upload policy) main.txt
  4. Run the application, and try clicking on the TextBox()

Expected behavior Tapping the TextBox() widget, should bring the focus on that widget and make it editable

Screenshots https://github.com/bdlukaa/fluent_ui/assets/132486634/4d348ce7-4ec0-46cf-9306-3d1a84395b9e

Additional context I was orgininally using this widget as part of the PlatformTextField from flutter_extended_platform_widgets. I reproduced this on Android, and managed to resolve it with some SO isssue, by adding keyboardType: TextInputType.text. But that is not available for this platform. The issue logged was something to do 'Cannot have 0 span ...', but no log from this package

M-Ahal commented 3 months ago

If I replace the pane with content, then it works as expected:

return NavigationView(
      appBar: const NavigationAppBar(),
      content: TextBox(
        placeholder: 'Name',
        expands: false,
        autofocus: true,
        autocorrect: false,
        onTap: () => debugPrint('does detect tap'),
        onChanged: (value) => debugPrint('does not detect change: $value'),
      ),
      // pane: NavigationPane(
      //   items: [
      //     PaneItem(
      //       icon: const Icon(FluentIcons.add),
      //       title: const Text('Add'),
      //       body: const _TextFieldPage(),
      //     ),
      //   ],
      // ),
    );

So the problem seems to be with the pane