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

fixed onSubmitted behavior and public State classes #86

Merged
merged 3 commits into from
May 11, 2023

Conversation

wszak
Copy link
Contributor

@wszak wszak commented May 10, 2023

  1. Calls onSubmitted with fixed up value in _handleFocusChanged. Otherwise there's no way to know the spinner value when the user switched to another form field after manually editing the value with keyboard.
  2. Removed underscores from State classes names to make them public. This way we can use GlobalKey with SpinBox'es and access their state.

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jpnurmi jpnurmi merged commit 8bc6394 into ubuntu-flutter-community:main May 11, 2023
@zhang-peter
Copy link

As I emphasized on issue #80, the onSubmitted function should be called when the Spinbox is enabled. Calling onSubmitted without proper validation can cause serious issues. This is because when the Spinbox transitions from a disabled state to an enabled state, it triggers the _handleFocusChanged function, which in turn triggers onSubmitted. However, the system may not want to accept this value.

@wszak
Copy link
Contributor Author

wszak commented May 12, 2023

But onSubmitted is called after fixupValue, so the value is validated.
Maybe you could write a test or provide a specific example that demonstrates the issues you mentioned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants