payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
24.94k stars 1.59k forks source link

Lexical: Clicking on three dots while having multiple cells selected crashes editor #8021

Closed tyteen4a03 closed 2 months ago

tyteen4a03 commented 2 months ago

Link to reproduction

No response

Environment Info

Node.js v20.12.2

Binaries:
  Node: 20.12.2
  npm: 10.5.0
  Yarn: 4.4.1
  pnpm: N/A
Relevant Packages:
  payload: 3.0.0-beta.97
  next: 15.0.0-canary.104
  @payloadcms/db-postgres: 3.0.0-beta.97
  @payloadcms/graphql: 3.0.0-beta.97
  @payloadcms/next/utilities: 3.0.0-beta.97
  @payloadcms/plugin-cloud-storage: 3.0.0-beta.97
  @payloadcms/plugin-nested-docs: 3.0.0-beta.97
  @payloadcms/richtext-lexical: 3.0.0-beta.97
  @payloadcms/storage-s3: 3.0.0-beta.97
  @payloadcms/translations: 3.0.0-beta.97
  @payloadcms/ui/shared: 3.0.0-beta.97
  react: 19.0.0-rc-06d0b89e-20240801
  react-dom: 19.0.0-rc-06d0b89e-20240801
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

Describe the Bug

Clicking the three dots to open the menu in this context will cause a crash.

Screenshot 2024-09-02 at 00 12 33
Unhandled Runtime Error
Error: Expected CellNode to have a RowNode parent

Source
packages/richtext-lexical/src/features/experimental_table/client/plugins/TableActionMenuPlugin/index.tsx (74:15) @ isTableSelectionRectangular

  72 |       const row = node.getParentOrThrow()
  73 |       if ($isTableRowNode(row)) {
> 74 |         throw new Error('Expected CellNode to have a RowNode parent')
     |               ^
  75 |       }
  76 |       if (currentRow !== row) {
  77 |         if (expectedColumns !== null && currentColumns !== expectedColumns) {
Call Stack
isTableSelectionRectangular
packages/richtext-lexical/src/features/experimental_table/client/plugins/TableActionMenuPlugin/index.tsx (187:11)

Reproduction Steps

  1. Create a table (default 5x5 is fine)
  2. Get the three dots to show up on hover, then select multiple cells
  3. Click on the (still-present) three dots button.

Adapters and Plugins

No response

tyteen4a03 commented 2 months ago

Duplicate of https://github.com/payloadcms/payload/issues/7961

github-actions[bot] commented 2 months ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.