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

How to insert HTML(like <div>) into <div calssName="ql-container"> #971

Closed
goodafteryoon opened this issue May 2, 2024 · 0 comments
Closed

Comments

@goodafteryoon
Copy link

goodafteryoon commented May 2, 2024

I want to place the side panel I made under the toolbar and inside the <div className="ql-container"/>
But it doesn't work as a render

import dynamic from "next/dynamic";
import styled from "@emotion/styled";
import { useEffect, useMemo } from "react";

import "react-quill/dist/quill.snow.css";

const QuillEditor = dynamic(() => import("react-quill"), { ssr: false });

const Editor = () => {
  const modules = useMemo(
    () => ({
      toolbar: {
        container: "#quilltoolbar",
      },

      clipboard: {
        matchVisual: false,
      },
    }),

    []
  );

  const formats = ["header", "bold", "italic", "underline", "bullet", "list"];

  useEffect(() => {
    console.log("Quill is ready!");
  }, []);

  return (
    <EditorContainer>
      <div id="quilltoolbar">
        <div className="tool">
          <button className="ql-bold">Bold</button>
          <button className="ql-italic">Italic</button>
          <button className="ql-underline">Underline</button>
          <button className="ql-list" value="ordered">
            List
          </button>
          <button className="ql-list" value="bullet">
            Bullet
          </button>
        </div>
      </div>
      <QuillEditor modules={modules} formats={formats}>
        <div className="editing-area">
          <div className="panel">left</div> // it dosen't render
          <div className="ql-editor" />
          <div className="right-panel">right</div> // it dosen't render too
        </div>
      </QuillEditor>
    </EditorContainer>
  );
};

export default Editor;

const EditorContainer = styled.div`
  width: 100vw;
  height: calc(100vh - 60px);
  overflow-y: hidden;
  overflow-x: hidden;
  top: 0px;
`;

Does anyone have HTML or components located inside the ql-container?

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

No branches or pull requests

1 participant