Skip to content

onTextChange call #85

Closed
Closed

Description

@zthrive

It appears that onTextChange call does not take in account corrected spelling.
If I use the controller, everything works as expected. However, this makes my code more complex and difficult to maintain.

Activity

  1. ZephyrRaine commented on Jun 11, 2025

    @ZephyrRaine

    Yes I confirm that when we apply a correction through the pop-up the callback is not called and there's no other events that could notify us. Did you find a workaround @zthrive?

  2. ZephyrRaine commented on Jun 11, 2025

    @ZephyrRaine

    While this issue is being fixed, here's how I'm handling the focus behavior in my implementation... Not perfect but it does the trick for my usage (since i don't need the updated values until i'm clicking out of the textfields)

    // Initialize focus nodes
    late final FocusNode _commentsFocusNode;
    late final FocusNode _conductFocusNode;
    
    @override
    void initState() {
      super.initState();
      _commentsFocusNode = FocusNode();
      _commentsFocusNode.addListener(() {
        if (!_commentsFocusNode.hasFocus) {
          widget.onCommentsChanged?.call(_commentsController.text);
        }
      });
    
      _conductFocusNode = FocusNode();
      _conductFocusNode.addListener(() {
        if (!_conductFocusNode.hasFocus) {
          widget.onConductChanged?.call(_conductController.text);
        }
      });
    }
    
    @override
    void dispose() {
      _commentsFocusNode.dispose();
      _conductFocusNode.dispose();
      super.dispose();
    }
    
    @override
    Widget build(BuildContext context) {
      return AppCard(
        child: Column(
          children: [
            // ... other widgets ...
            AppLangTextField(
              controller: _commentsController,
              focusNode: _commentsFocusNode,
              // ... other properties ...
            ),
            // ... other widgets ...
            AppLangTextField(
              controller: _conductController,
              focusNode: _conductFocusNode,
              // ... other properties ...
            ),
            // ... other widgets ...
          ],
        ),
      );
    }
  3. illia-romanenko commented on Sep 8, 2026

    @illia-romanenko
    Contributor

    fixed in #107 - pending release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions