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

Slash menu style is distorted on Next.js project #670

Closed
i-am-chitti opened this issue Mar 29, 2024 · 10 comments
Closed

Slash menu style is distorted on Next.js project #670

i-am-chitti opened this issue Mar 29, 2024 · 10 comments
Assignees
Labels
bug Something isn't working prio:high High priority

Comments

@i-am-chitti
Copy link
Contributor

i-am-chitti commented Mar 29, 2024

Describe the bug
I used this library with a fresh Next.js @ 14.1.4 release. On loading the editor as guided here- https://www.blocknotejs.org/docs/advanced/nextjs, the slash menu style is broken -
image

Also, noticed that this style is broken -
image

To Reproduce

  1. Create a next js project -
npx create-next-app@latest blocknote-next-js --typescript --eslint
  1. cd blocknote-next-js
  2. Add blocknote lib - npm install @blocknote/core @blocknote/react
  3. Follow the guide - https://www.blocknotejs.org/docs/advanced/nextjs and add the Editor
  4. Start development server
  5. Press / and you'll get the distorted styling

Misc

  • Node version: 18.18.0
  • Package manager: 9.8.1
  • Browser: Google Chrome - Version 123.0.6312.59 (Official Build) (arm64)

Note
I'm using the exact same code as suggested in the doc. Have already imported the "react/style.css"

@i-am-chitti i-am-chitti added the bug Something isn't working label Mar 29, 2024
@quuu
Copy link

quuu commented Mar 29, 2024

Am also hitting this issue on a fresh repo

@quuu
Copy link

quuu commented Mar 30, 2024

The stackblitz linked in the docs also is directly repro-able for this issue

CleanShot 2024-03-29 at 17 19 22@2x

@siddharthbulia
Copy link

Same issue here. It is not working in regular project as well.

@siddharthbulia
Copy link

siddharthbulia commented Mar 30, 2024

@i-am-chitti and @quuu

I have been able to fix it by installing @mantine/core@7.5.0 and by adding import "@mantine/core/style.css at the start of my App.jsx
It seems like this file should have automatically been imported but is not happening.

import "@blocknote/core/fonts/inter.css";
import { BlockNoteView, useCreateBlockNote } from "@blocknote/react";
import "@blocknote/react/style.css";
import "@mantine/core/style.css"

export default function App() {
  // Creates a new editor instance.
  const editor = useCreateBlockNote();

  // Renders the editor instance using a React component.
  return <BlockNoteView editor={editor} />;
}

@kyen99
Copy link

kyen99 commented Mar 30, 2024

In order to get this to work with latest @blocknote I had to do what @siddharthbulia suggested above, but I had to install @mantine/core@7.7.1 instead of 7.5.0 (which gave me dependency warnings and didn't work).

@DaviRJ
Copy link

DaviRJ commented Mar 30, 2024

Same problem here. Nextjs 14.1. @siddharthbulia fixed the Blocknote layout but broke up all styles of my app 😅 I'm using Tailwind and shadcn.

Bellow some images to exemplify.

Blocknote without manually import:

image

image

Blocknote manually importing @mantime/core/styles.css:

image

@YousefED
Copy link
Collaborator

Thanks for the reports. This seems like a recent regression, we'll fix it asap!

@shahyan3
Copy link

@YousefED Thanks. Do post an update when fixed please.

@YousefED YousefED added the prio:high High priority label Mar 31, 2024
@SPCODER-DEV
Copy link

it works like this so far

Adding "@mantine/core/styles.css" and also importing "@/app/globals.css"

"@mantine/core": "^7.7.1"

@YousefED
Copy link
Collaborator

YousefED commented Apr 3, 2024

Hi all! Turns out this was caused by a Mantine update. It should be fixed in the latest BlockNote release! (0.12.4)

#678

@YousefED YousefED closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:high High priority
Projects
None yet
Development

No branches or pull requests

9 participants