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

Focus lost when updating navigation link label #46242

Closed
ajlende opened this issue Dec 1, 2022 · 7 comments
Closed

Focus lost when updating navigation link label #46242

ajlende opened this issue Dec 1, 2022 · 7 comments
Labels
[Block] Navigation Link Affects the Navigation Link Block [Type] Bug An existing feature does not function as intended

Comments

@ajlende
Copy link
Contributor

ajlende commented Dec 1, 2022

Description

On the navigation link and navigation submenu blocks, the label input loses focus when entering any text.

Step-by-step reproduction instructions

  1. Select or add a navigation link to the navigation menu
  2. In the block controls sidebar update the label
  3. See that focus is lost and you can only type one or two letters at a time

Screenshots, screen recording, code snippet

focus lost when typing

Environment info

  • WordPress trunk (6.2.0)
  • Gutenberg trunk (14.7.0-rc.1)
  • Firefox 107.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@ajlende ajlende added [Type] Bug An existing feature does not function as intended [Block] Navigation Link Affects the Navigation Link Block labels Dec 1, 2022
@ajlende
Copy link
Contributor Author

ajlende commented Dec 1, 2022

I was told this may have happened after this refactor. I haven't confirmed it myself, but it may be a place to start looking for the fix.

@getdave
Copy link
Contributor

getdave commented Dec 1, 2022

Screen.Capture.on.2022-12-01.at.19-11-59.mp4

Hmmmm I can't seem to replicate this in the Post Editor using Chrome. Any other reproduction steps?

@getdave
Copy link
Contributor

getdave commented Dec 1, 2022

Confirmed this is FF specific. I was able to replicate.

@getdave
Copy link
Contributor

getdave commented Dec 1, 2022

I think I have tracked this to packages/block-editor/src/components/rich-text/use-firefox-compat.js

...which is included on the <RichText> component here

If I remove the hook then I don't get the focus bug.

@getdave
Copy link
Contributor

getdave commented Dec 2, 2022

....but I don't know what the fix is. It is a bug with the hook or a bug in our implementation???

@MaggieCabrera
Copy link
Contributor

It was not the refactor, but the bug is weirder than I initially thought. This is what I did:

I checked out 821db1c which is the commit previous to the refactor, and then added a link to my navigation and edited the label. It works fine for a few seconds and then the focus gets lost.

ezgif-4-2e5e28f387

@MaggieCabrera
Copy link
Contributor

can't seem to reproduce this anymore, closing. Feel free to reopen if it comes back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants