You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(editor): prevent duplicate onChanged events, cursor false positives, and missing default highlighting in QueryaCodeEditor #1430
Duplicate onChanged invocations:
In build(), onChanged: widget.onChanged is passed to TextField. At the same time, _attachListener() binds _onTextChanged to _effectiveController, which also executes widget.onChanged?.call(_effectiveController.text). This causes onChanged to fire twice per keystroke.
False positive onChanged on cursor moves / selection: _effectiveController.addListener(_onTextChanged) triggers on any change to TextEditingValue, including selection and cursor position. Without tracking _lastText, simply clicking or moving arrow keys invokes widget.onChanged.
Missing syntax highlighting when controller == null: enableHighlighting is declared with doc When true and [language] is SQL/JSON, uses [syntax_highlight] if initialized, but _initControllerIfNeeded() always creates a plain material.TextEditingController() without highlighters. enableHighlighting is never read.
didUpdateWidget ignores language/highlight changes:
Only oldWidget.controller != widget.controller is checked. Toggling language does not reconfigure highlighters or controller.
Acceptance Criteria
onChanged is called exactly once per text modification, and never on cursor/selection changes.
When controller == null and enableHighlighting == true, QueryaCodeEditor creates a QueryaHighlightController via SyntaxHighlightService.
didUpdateWidget reacts to changes in widget.language and widget.enableHighlighting.
Unit tests cover duplicate prevention, cursor-movement safety, and default syntax highlighting.
Activity
Merge pull request #1446 from QueryaHub/issue/1430-code-editor-events…
ZhuchkaTriplesix commentedon Oct 11, 2026
Fixed and verified in PR #1446.