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

fix: Various multi-column bugs #1240

Merged
merged 6 commits into from
Nov 14, 2024
Merged

fix: Various multi-column bugs #1240

merged 6 commits into from
Nov 14, 2024

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented Nov 12, 2024

This PR fixes 4 bugs to do with multi-column blocks:

  1. Dragging a block from one column to another in the same column list now works properly. Previously, it would copy the dragged block instead of moving it.
  2. Fixed bug where creating a new column list above an existing one would merge them. This was due to incorrect positions being used in removeBlocksWithCallback.
  3. Fixed bug where dropping a block inside a new column in a column list would sometimes throw an error, as nodeDOM would return null due to the cursor position being outdated. I've managed to reproduce this consistently using the document setup below, and dragging the "bbbbb" block between the "c" and "d" blocks.
  4. Fixed error being thrown after live reload due to event listeners not getting cleaned up in the column resize extension.

Document to reproduce issue 3:

[
  {
    type: "columnList",
    children: [
      {
        type: "column",
        children: [
          {
            type: "paragraph",
            content: "a",
          },
        ],
      },
      {
        type: "column",
        children: [
          {
            type: "paragraph",
            content: "bbbbb",
          },
        ],
      },
    ],
  },
  {
    type: "columnList",
    children: [
      {
        type: "column",
        children: [
          {
            type: "paragraph",
            content: "c",
          },
        ],
      },
      {
        type: "column",
        children: [
          {
            type: "paragraph",
            content: "d",
          },
        ],
      },
    ],
  },
  {
    type: "paragraph",
  },
],

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Nov 14, 2024 0:40am
blocknote-website ✅ Ready (Inspect) Visit Preview Nov 14, 2024 0:40am

@tommerty
Copy link
Contributor

Can I ask that if the resizing/dragging of columns be disabled if editable is false? 🙏🏻 #1244

@matthewlipski
Copy link
Collaborator Author

Can I ask that if the resizing/dragging of columns be disabled if editable is false? 🙏🏻 #1244

Will fix shortly! But in a separate PR

@matthewlipski matthewlipski merged commit 98404ae into main Nov 14, 2024
4 checks passed
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 this pull request may close these issues.

3 participants