Mention combobox throws error and fails to open after deleting a mention
Description
Certain user interactions involving Mentions and the Mention Combobox lead to a subsequent error when attempting to add a new mention: Uncaught (in promise) Error: Could not get the bounding client rect of the location. Please provide a fallbackRect.
This is being thrown by floating-ui, and seems to originate in Plate from the plate-floating > createVirtualRef function called in the Combobox component.
Steps
https://github.com/udecode/plate/assets/16843426/e98531ca-5807-45ae-80ec-9f4b945e52b9
- Add a mention followed by a space.
- Use arrow keys to select the mention
- Delete the mention
- Attempt to add a new mention
Sandbox https://platejs.org/ (this can be reproduced without modification in the Plate Playground in the docs)
Expectation Should see the combobox and be able to add a new mention.
Environment Plate Docs Playground at the time of writing
Funding
- You can sponsor this specific effort via a Polar.sh pledge below
- We receive the pledge once the issue is completed & verified