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

fix(editor): Auto-focus expression input when switching from "fixed" mode #10686

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

OlegIvaniv
Copy link
Contributor

Summary

A small fix to retain input focus when switching to expression mode.

CleanShot.2024-09-05.at.13.20.29.mp4

Related Linear tickets, Github issues, and Community forum posts

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)

@@ -941,6 +941,14 @@ watch(remoteParameterOptionsLoading, () => {
tempValue.value = displayValue.value as string;
});

// Focus input field when changing from fixed value to expression
watch(isModelValueExpression, async (isExpression, wasExpression) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please add tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to test the focused state of the inline expression input. It's using Codemirror; hence, it's rendered as a div, not an input

Copy link
Member

@elsmr elsmr left a comment

Choose a reason for hiding this comment

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

Nice 🎉 much smoother experience!

Copy link

cypress bot commented Sep 5, 2024

n8n    Run #6754

Run Properties:  status check passed Passed #6754  •  git commit 70fd5761d4: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Project n8n
Branch Review autofocus-expression-after-switching
Run status status check passed Passed #6754
Run duration 04m 51s
Commit git commit 70fd5761d4: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Committer Oleg Ivaniv
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 424
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Sep 5, 2024

✅ All Cypress E2E specs passed

@OlegIvaniv OlegIvaniv merged commit 54ab2b1 into master Sep 6, 2024
48 checks passed
@OlegIvaniv OlegIvaniv deleted the autofocus-expression-after-switching branch September 6, 2024 07:17
@github-actions github-actions bot mentioned this pull request Sep 11, 2024
@Joffcom
Copy link
Member

Joffcom commented Sep 11, 2024

Got released with [email protected]

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

Successfully merging this pull request may close these issues.

4 participants