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

UI Bug fix, cursor jumps in KVv2 after initial input #27120

Merged
merged 6 commits into from
May 20, 2024

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented May 17, 2024

This was a fun one 🕵🏻‍♀️.

Regression PR (I think, but I'll test on 1.15.x to make sure)
Fixes Issue #26634

  • Codemirror's setValue resets the cursor position.
  • It was being called in the modifier because the following condition was passing this._editor.getValue() !== namedArgs.content
  • The reason these values did not match was because we had in—KVv2 only— set the default value as a flat json object without whitespace:
    image
    vs what Codemirror's namedArgs.content is set at by default:
    image

This is not an issue in Cubbyhole which is how I found the solution to match the objects. TLDR, I used this function to figure out what we needed and brought it into the kv-data-fields component to properly set the starting value, tada!

Bug:

bug-jump.mov

With Fix:

fix-jump.mov

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 17, 2024
@Monkeychip Monkeychip added ui backport/1.15.x Backport changes to `release/1.15.x` backport/1.16.x Backport changes to `release/1.16.x` labels May 17, 2024
@Monkeychip Monkeychip added this to the 1.17.0-rc milestone May 17, 2024
Copy link

github-actions bot commented May 17, 2024

CI Results:
All Go tests succeeded! ✅

@Monkeychip Monkeychip marked this pull request as ready for review May 17, 2024 19:47
@Monkeychip Monkeychip requested a review from a team as a code owner May 17, 2024 19:47
Copy link

Build Results:
All builds succeeded! ✅

Copy link
Collaborator

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Elegant solution, thank you for tracking it down! 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.15.x Backport changes to `release/1.15.x` backport/1.16.x Backport changes to `release/1.16.x` hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants