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

Maximum update depth exceeded when hitting space key while editing a related document #177

Closed
linobino1 opened this issue May 3, 2024 · 2 comments · Fixed by payloadcms/payload#6286
Assignees

Comments

@linobino1
Copy link

linobino1 commented May 3, 2024

When you edit a document of a collection that has a relationship field with hasMany: true, and then you edit one of the related documents "inline" via the little pencil icon in the relationship field, React will run into a Maximum update depth exceeded. as soon as you hit the space key.

run this repo and just add this to the config at collections.pages.fields:

{
          name: 'users',
          type: 'relationship',
          relationTo: 'users',
          hasMany: true,
},
  1. edit a page
  2. select a user in the users field
  3. edit the selected user via the pencil icon
  4. hit space
@linobino1 linobino1 changed the title lexicalHTML field provokes Maximum update depth exceeded when hitting space key while editing a related document Maximum update depth exceeded when hitting space key while editing a related document May 3, 2024
@AlessioGr AlessioGr self-assigned this May 3, 2024
@linobino1
Copy link
Author

I just noticed that actually it doesn't have anything to do with lexical... It also happens if the pages collection only has the relationship field and nothing else.

@AlessioGr AlessioGr removed their assignment May 3, 2024
@JessChowdhury JessChowdhury self-assigned this May 6, 2024
JessChowdhury added a commit to payloadcms/payload that referenced this issue May 15, 2024
## Description

Closes [#117](payloadcms/payload-3.0-demo#177)
- hitting the space key while the `ReactSelect` is in focus crashes the
page.

This PR makes the following changes:
- Multivalue select component updated to only use `id`, drag feature
does not work when using `uuid()`
- Ensures relationship field (multi and single value) can be accessed
via the keyboard

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [X] Existing test suite passes locally with my changes
@JessChowdhury
Copy link
Member

Hey @linobino1 - thanks for reporting this! The issue has been fixed and will go out in the next release.

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

Successfully merging a pull request may close this issue.

3 participants