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

getHtml() returns empty string in react-native-cn-quill version 0.7.18 #138

Open
zahrafalah opened this issue Oct 1, 2024 · 0 comments
Open

Comments

@zahrafalah
Copy link

Description

When calling getHtml() after editing content in the editor, the method returns an empty string.

Steps to Reproduce

  1. Set up a QuillEditor component in a React Native project.
  2. Add some initial HTML content using the initialHtml prop.
  3. Edit the content in the editor.
  4. Call getHtml() and observe that it returns an empty string.

Expected Behavior

getHtml() should return the current HTML content in the editor.

Actual Behavior

getHtml() returns an empty string.

Environment

Package version: "react-native-cn-quill": "^0.7.18"
React Native version: "react-native": "^0.74.3"
Platform: Web
WebView version: "react-native-webview": "^11.0.0",

Code Example

const quillRef = useRef(null);

const handleSave = async () => {
  try {
    const htmlContent = await quillRef.current.getHtml();
    console.log("HTML Content: ", htmlContent); // Logs an empty string
  } catch (error) {
    console.error("Error: ", error);
  }
};

return (
  <QuillEditor 
      ref={quillRef} 
      initialHtml="<p>Initial Content</p>" 
      onHtmlChange={({ html }) => console.log("HTML Changed: ", html)} // Does not trigger
/>
);

@zahrafalah zahrafalah changed the title getHtml() returns empty string in react-native-cn-quill version x.x.x getHtml() returns empty string in react-native-cn-quill version 0.7.18 Oct 1, 2024
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