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

Live and demo URL input focus is lost after first character is typed #1307

Closed
jseppi opened this issue Nov 22, 2017 · 4 comments
Closed

Live and demo URL input focus is lost after first character is typed #1307

jseppi opened this issue Nov 22, 2017 · 4 comments
Assignees
Labels

Comments

@jseppi
Copy link
Contributor

jseppi commented Nov 22, 2017

Steps to reproduce:

  1. Click into a blank Live (or Demo) URL input box on the Site Settings page.
  2. Type a character. The focus will jump to the Save Basic Settings button.

Expected behavior:
Focus remains in the input box while typing.

url-focus-lost

@jseppi
Copy link
Contributor Author

jseppi commented Nov 22, 2017

It is due to code like this, which results in React re-rendering the component on change, which then makes the input lose focus (because it's actually a new DOM element):

component={p =>
  <HttpsUrlInput
    value={p.input.value}
    onChange={p.input.onChange}
    className="form-control"
    id="domainInput"
  />
}

This method was taken from the ReduxForm docs, but those examples are apparently wrong. More explanation at redux-form/redux-form#1094

@wslack
Copy link
Contributor

wslack commented Nov 22, 2017

Effort to fix?

@jseppi
Copy link
Contributor Author

jseppi commented Nov 22, 2017 via email

@wslack
Copy link
Contributor

wslack commented Nov 24, 2017

Makes sense, seems like we can put in "Ready" for you to pull off when wanted.

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

No branches or pull requests

2 participants