Giter VIP home page Giter VIP logo

ckeditor5-svelte's Introduction

Hi there ๐Ÿ‘‹

ckeditor5-svelte's People

Contributors

jecovier avatar techlab23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckeditor5-svelte's Issues

CKEditor 5 does not have a read only setter

Problem
Line 42 of Ckeditor.svelte tries to set the read-only status with this piece of code: editor.isReadOnly = disabled;.
This is not supported by CKEditor 5, because read-only has no setter. Read more here.

Screenshot of the error message
image

Suggested Solution
Since I don't see the purpose of disabling the editor anyway, I would suggest removing the line altogether.

Trying to use this with Sapper

I copied and pasted the sample code you showed in the README and this is what I get when I run npm run dev:

A ton of gibberish - server crashed -

image

editor is null when using with sapper

<script>
        import CKEditor from "ckeditor5-svelte";
	// Setting up editor prop to be sent to wrapper component
	let editor ;
	// Reference to initialised editor instance
	let editorInstance = null;
	// Setting up any initial data for the editor
	let editorData = "Hello World";

	// If needed, custom editor config can be passed through to the component
	// Uncomment the custom editor config if you need to customise the editor.
	// Note: If you don't pass toolbar object then Document editor will use default set of toolbar items.
	let editorConfig = {
		toolbar: {
			items: [
				"heading",
				"|",
				"fontFamily",
				"fontSize",
				"bold",
				"italic",
				"underline",
			],
		},
	};

	onMount(async () => {
		const module = await import(
			"@ckeditor/ckeditor5-build-decoupled-document/build/ckeditor"
		);

		editor = module
		console.log('_____',editor)
	});

        function onReady({ detail: editor }) {
		// Insert the toolbar before the editable area.
		editorInstance = editor;
		editor.ui
			.getEditableElement()
			.parentElement.insertBefore(
				editor.ui.view.toolbar.element,
				editor.ui.getEditableElement()
			);
	    }

</script>
<CKEditor
							on:ready={onReady}
							bind:config={editorConfig}
							bind:value={editorData}
						/>

I am getting Uncaught (in promise) TypeError: editor is null

How to use it in sapper ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.