Skip to content

Change in v10.11.1 causes inputs to lose focus on DOM changes #3814

@jcestibariz

Description

@jcestibariz
  • Check if updating to the latest Preact version resolves the issue (no)

Describe the bug
Up to preact v10.11.0 changes in the DOM did not cause a focused input to lose focus. Starting with v10.11.1 the input loses focus.

To Reproduce

Steps to reproduce the behavior:

  1. Check out https://github.com/jcestibariz/bug-preact-focus
  2. Notice preact is locked to v10.11.0 which does not contain the bug
  3. Run npm i and then npm start
  4. In the browser click on the input and press backspace
  5. Notice the last "tag" is removed but the input keeps focus.
  6. Go back to the console and press Ctrl+C to stop the server
  7. Run npm i preact@10.11.1 and then npm start
  8. Go back to the browser and repeat step 4
  9. Notice now the input loses focus
  10. You can also check with the latest version (v10.11.3 as of this moment) the bug is still present

Expected behavior
The input should not lose focus when DOM changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions