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

Packaging components edition - Cursor is at top of 1st component when adding a 2nd component #3622

Closed
stephanegigandet opened this issue Jan 23, 2023 · 3 comments · Fixed by #3716
Assignees
Labels
🐛 bug Something isn't working

Comments

@stephanegigandet
Copy link
Contributor

When a product has 1 packaging component, clicking on "adding a component" adds the 2nd component but the view is scrolled up to the first field of the 1st component. Curiously that does not happen when adding a 3rd or 4th component.

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Jan 23, 2023

@stephanegigandet
Copy link
Contributor Author

@monsieurtanuki It's a very annoying bug when I enter new components, so I tried to fix this by focusing on the unitNumber line when _addPackagingToControllers is called with initiallyExpanded set to true, but I'm not sure how to get to its focusNode which is defined a long way off in SimpleInputNumberField. I'm quite lost in the code, it's hard for me to grasp the role of the helpers classes etc. Would you have some time to look at this bug?

@monsieurtanuki
Copy link
Contributor

I confirm that FocusNode is a pain in the neck.

From what I read using them is not a best practice:

An object that can be used by a stateful widget to obtain the keyboard focus and to handle keyboard events.
Please see the Focus and FocusScope widgets, which are utility widgets that manage their own FocusNodes and FocusScopeNodes, respectively. If they aren't appropriate, FocusNodes can be managed directly, but doing this yourself is rare.

I may find time this week-end to have a look at it. Possible solutions:

  • get rid of them altogether
  • replace them with either Focus or FocusScope
  • remove the autofocus = true statements

Whatever works.

Meanwhile, if someone could have a look at #3712 it would save us developers the tap dancing between flutter 3.7.x and 3.0.5.
@M123-dev Any idea what this means, and how possible it would be to integrate the code into Smoothie?

  camera:
    git:
      url: "https://github.com/openfoodfacts/smooth_app_plugins_fork.git"
      ref: "smooth_camera"
      path: "packages/camera/camera"
  camera_platform_interface:
    git:
      url: "https://github.com/openfoodfacts/smooth_app_plugins_fork.git"
      ref: "smooth_camera"
      path: "packages/camera/camera_platform_interface"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants