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

Unable to go to new line on list items #3190

Open
th1nkful opened this issue May 9, 2024 · 2 comments
Open

Unable to go to new line on list items #3190

th1nkful opened this issue May 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@th1nkful
Copy link

th1nkful commented May 9, 2024

Description

When hitting enter to go to a new line on UL or OL list items, it clears the line instead of adding a new line.

Does not happen in demos, does happen if i use the template and start from scratch

Steps to Reproduce

  • Install all the latest packages
  • add list items
  • try to hit enter on a list item to go to new line
  • line is cleared instead

Sandbox

I tried to make a sandbox, but they are really out of date

I ended up getting Codesandbox to spin a devbox of a repro

https://codesandbox.io/p/github/th1nkful/plate-issue/main?import=true

repro repo: https://github.com/th1nkful/plate-issue

Expected Behavior

When you hit "Enter" you are taken to a new line with another LI

Environment

  • slate: 0.102.0
  • slate-react: 0.102.0
  • browser: chrome

Bounty

Click here to add a bounty via Algora.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@th1nkful th1nkful added the bug Something isn't working label May 9, 2024
@th1nkful
Copy link
Author

Not sure if this needs to be updated into a documentation change or something but I found the cause:

In the playground installation guide it has the following:

    createExitBreakPlugin({
      options: {
        rules: [
          {
            hotkey: 'mod+enter',
          },
          {
            hotkey: 'mod+shift+enter',
            before: true,
          },
          {
            hotkey: 'enter',
            query: {
              start: true,
              end: true,
              // allow: KEYS_HEADING,
            },
            relative: true,
            level: 1,
          },
        ],
      },
    }),

However, when you use that, it was resetting the line item. Uncommenting and importing KEYS_HEADING causes this to behave as expected

@devonkcopeland
Copy link

devonkcopeland commented May 16, 2024

@th1nkful I think this issue seems related to #2736

I tried what was mentioned in that thread (moving createListPlugin() to after createResetNodePlugin()) but I was unable to resolve the issue. Curious if it fixes it for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants