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

User mention suggestions can't be exited from within a list block #43063

Closed
chad1008 opened this issue Aug 8, 2022 · 5 comments
Closed

User mention suggestions can't be exited from within a list block #43063

chad1008 opened this issue Aug 8, 2022 · 5 comments
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended

Comments

@chad1008
Copy link
Contributor

chad1008 commented Aug 8, 2022

Description

When adding a user mention within a list block pressing enter multiple times does not successfully exit the autocompleter and in turn the list block itself.

Effectively, a user can find themselves trapped in a list block after inserting a user mention, unless they forcibly exit the autocomplete.

There are actually two symptoms here, which appear to have been introduced separately:

  1. Getting trapped inside the autocomplete and by extension, the list block. This appears to have been present since at least v12.7.0. I didn't have bandwidth to try tracing it further back than that.
  2. The second, seemingly newer, issue is that after selecting a user mention and starting a new list item, the user mention suggestions appear in the upper left hand corner of the screen rather than at the cursor. This appears to have been introduced as part of the Popover components floatinUI refactor (cc @ciampo, I know you've been doing some work in that area recently)

Ordinarily I'd view these as two separate bugs, but the second one only happens after the initial completion, when the autocomplete persists after a selection. If that weren't happening, it doesn't look like we'd have the second issue without the first.

Step-by-step reproduction instructions

  1. create a new post
  2. type - test to open a list block
  3. press enter to create a new list element
  4. type test 2 @a to trigger a user mention (change the trigger text as needed to match a user on your test site)
  5. press enter once to select a username
  6. press enter a second time to create a new list element
  7. notice the user mention suggestions persist, but relocate to the upper left corner of the viewport
  8. press enter a third time to escape the list block
  9. notice that rather than escaping the block, your user mention is re-selected, taking you back to the previous list entry
  10. continue pressing enter. You're now caught in a loop of creating a new line, and re-selecting your mention, then repeating
  11. abandon the enter key, it has forsaken you
  12. press escape to close the completer. Now you can use enter again to escape the list block

Note: if the first user mention inside the list block doesn't trigger the above behavior, try entering another one on the second list item. In my testing there were rare occasions where the bug wouldn't manifest until the second or third user mention.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@talldan
Copy link
Contributor

talldan commented Aug 9, 2022

Hopefully the second issue is fixed by #42971. Reviewing that now.

edit: I can't reproduce that issue on trunk, so perhaps already fixed or there are a more complex set of reproduction steps.

@ciampo
Copy link
Contributor

ciampo commented Aug 9, 2022

#42971 has just been merged — @chad1008 , can you still reproduce this popover-related issue on latest trunk ?

@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended [Block] List Affects the List Block labels Aug 17, 2022
@chad1008
Copy link
Contributor Author

Sorry for the delayed response @ciampo, but no I'm no longer seeing this bug in trunk 🎉

@ciampo
Copy link
Contributor

ciampo commented Aug 31, 2022

Can you still reproduce the other part of this issue? If so, we should update the issue's description to leave only the relevant bug.

If that also can't be reproduced, then we can close this issue instead :)

@ciampo
Copy link
Contributor

ciampo commented Sep 5, 2022

I couldn't reproduce this issue on latest trunk — going to close this issue (feel free to reopen if necessary)

@ciampo ciampo closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants