Skip to content

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

Merged
dimitropoulos merged 2 commits intoKong:developfrom
dimitropoulos:feat/focus-url-bar
Jan 5, 2022
Merged

AutoFocus URL bar when onboarding/switching/opening a request#4338
dimitropoulos merged 2 commits intoKong:developfrom
dimitropoulos:feat/focus-url-bar

Conversation

@dimitropoulos
Copy link
Copy Markdown
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.
@dimitropoulos dimitropoulos self-assigned this Jan 4, 2022
Copy link
Copy Markdown
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!

Comment thread packages/insomnia-app/app/ui/components/panes/request-pane.tsx
@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