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

[propose] onSubmitted can be called when TextField loses focus and Spinbox is enabled. #80

Open
zhang-peter opened this issue Dec 13, 2022 · 0 comments · May be fixed by #87
Open

[propose] onSubmitted can be called when TextField loses focus and Spinbox is enabled. #80

zhang-peter opened this issue Dec 13, 2022 · 0 comments · May be fixed by #87

Comments

@zhang-peter
Copy link

This behavior is very like valueModified of SpinBox in Qt Quick Control.

  void _handleFocusChanged() {
    setState(() {
      if (hasFocus) {
        _selectAll();
      } else {
        if (widget.enabled) {
          final value = fixupValue(_controller.text);
          widget.onSubmitted?.call(value);
        }
      }
    });
  }
zhang-peter referenced this issue May 12, 2023
* call onSubmitted when losing focus

* make State classes public

* bugfix: fixup wasn't called when onSubmitted was null

---------

Co-authored-by: md <[email protected]>
Co-authored-by: ws <[email protected]>
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 a pull request may close this issue.

1 participant