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

[BUG]: Advanced Setup not working #264

Closed
sarvasvkulpati opened this issue Jan 15, 2025 · 5 comments
Closed

[BUG]: Advanced Setup not working #264

sarvasvkulpati opened this issue Jan 15, 2025 · 5 comments

Comments

@sarvasvkulpati
Copy link

I can't seem to get the advanced setup running. The toolbar never shows up and the wordcounter example never works.

  • I followed the advanced setup tutorial, but nothing was working. The extensions didn't run.
  • after that didn't work for a while, I even downloaded the editor-web folder from the github repo, replaced mine with it, and used the repos AdvancedRichText example. This also didn't work (Screenshot attached)

at this point I think I'm probably doing something silly. Let me know if there's other information I can share.

IMG_C8400B5EB2FE-1

@bambie1
Copy link

bambie1 commented Feb 8, 2025

Experiencing a similar issue with a fresh expo project. See repo here https://github.com/bambie1/test-rich-text

  • CounterBridge not working
  • Toolbar is shown, but disabled

@17Amir17 any ideas what I could be doing wrong?

@victoriashih
Copy link

I also struggled to get the advanced setup working based on the example. I did eventually get it working by making the "bridges" in AdvancedEditor match the "bridgeExtensions" in AdvancedRichText

export const AdvancedEditor = () => {
  const editor = useTenTap({
    bridges: [SpoilerBridge, ...TenTapStartKit], // Add our custom spoiler bridge
  });

  return (
    <EditorContent
      editor={editor}
      className={window.dynamicHeight ? "dynamic-height" : undefined}
    />
  );
};
export const RichTextEditor = ({
  initialContent: initialContent,
  onChange,
}: RichTextEditorProps) => {
  const editor = useEditorBridge({
    customSource: editorHtml, // Custom web editor implementation (advanced setup)
    autofocus: true, 
    initialContent: initialContent,
    bridgeExtensions: [SpoilerBridge, ...TenTapStartKit], // Add our custom spoiler bridge
    avoidIosKeyboard: true, 
    onChange: () => {
      console.log("[RichTextEditor] Content changed");
      editor.getHTML().then((html) => {
        console.log("[RichTextEditor] New content:", html);
        onChange?.(html);
      });
    },
  });

@17Amir17
Copy link
Collaborator

17Amir17 commented Feb 9, 2025

Hey guys,
Since a bunch of people are having a hard time setting this up - I will create an example repo with this 👍

@bambie1
Copy link

bambie1 commented Feb 10, 2025

thanks @victoriashih. Your suggestion helped, and I got it working now 🎉

I changed AdvancedEditor.tsx here: bambie1/test-rich-text@34b3d68

@17Amir17
Copy link
Collaborator

https://github.com/10play/10TapAdvancedExample

Will update this in the docs

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

4 participants