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

AutoFocus URL bar when onboarding/switching/opening a request #4338

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

dimitropoulos
Copy link
Contributor

@dimitropoulos dimitropoulos commented Jan 4, 2022

2022-01-04_13-43-25.mp4

There are three behaviors this PR changes:

  1. when onboarding, after clicking through the analytics modal the url bar will focus
  2. after creating a new request, the URL bar will focus
  3. after switching to a new request, the URL bar will focus (note, that this (logically speaking) also means that it will focus when switching to a new request when there wasn't one previously, such as from the dashboard).

closes INS-1308
changelog(Improvements): URL bar will now autofocus when interacting with new requests or switching between requests

I tried and tried to make it work before, but I kept getting errors (because you have to use the unsafe legacy lifecycle methods) including `unstable_flushDiscreteUpdates: Cannot flush updates when React is already Rendering` and `RequestPane.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned.`

It's already stateless, so a good candidate to switch now since it blocked me.
Copy link
Contributor

@gatzjames gatzjames left a comment

Choose a reason for hiding this comment

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

LGTM! Great improvement!

@dimitropoulos dimitropoulos merged commit 29a7818 into Kong:develop Jan 5, 2022
@dimitropoulos dimitropoulos deleted the feat/focus-url-bar branch January 5, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants