Skip to content

fix(editor): Prevent cursor from jumping in the focus panel (no-changelog) #17976

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dariacodes
Copy link
Contributor

@dariacodes dariacodes commented Aug 4, 2025

Summary

When typing quickly in the focus panel input, the cursor would unexpectedly jump to the end of the text. This was caused by the use of a debounce wrapper around valueChanged, which introduced asynchronous updates, which triggered Vue to re-evaluate resolvedParameter.value and re-bind it to the input, causing the DOM to reset the cursor position.

  • Remove debounce() from valueChanged to ensure updates happen synchronously and predictably.
  • Introduce a local ref (inputValue) as a stable intermediary between user input and the reactive resolvedParameter.value to avoid directly binding the input to a recomputed value that may change identity on every render.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-3879/bug-focus-panel-cursor-jumps-randomly-to-end-of-text-while-typing

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@dariacodes dariacodes changed the title fix(editor): Prevent cursor from jumping in the focus panel fix(editor): Prevent cursor from jumping in the focus panel (no-changelog) Aug 4, 2025
Copy link

bundlemon bot commented Aug 4, 2025

BundleMon

Files added (2)
Status Path Size Limits
WASM Dependencies
tree-sitter-bash.wasm
+181.26KB -
WASM Dependencies
tree-sitter.wasm
+74.47KB -

Total files change +255.73KB

Groups added (2)
Status Path Size Limits
**/*.js
+5.36MB -
**/*.css
+188.8KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Aug 4, 2025
@dariacodes dariacodes self-assigned this Aug 4, 2025
@dariacodes dariacodes marked this pull request as ready for review August 4, 2025 16:21
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 1 file. Review in cubic

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

Successfully merging this pull request may close these issues.

1 participant