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

Confusing behavior of CKEditor 5 when launching the editor on a <textarea> element #1591

Closed
wwalc opened this issue Mar 4, 2019 · 3 comments · Fixed by ckeditor/ckeditor5-core#173
Labels
type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@wwalc
Copy link
Member

wwalc commented Mar 4, 2019

There are several places where we show an example of Classic editor being launched on top of a <textarea> element:

If someone takes such an example and later tries to change the editor type (e.g. the Balloon editor), then will see that the editor no longer shows up:

<!DOCTYPE html>
<html>
        <head>
                <meta charset="utf-8">
                <title>CKEditor</title>
                <script src="https://cdn.ckeditor.com/ckeditor5/12.0.0/balloon/ckeditor.js"></script>
        </head>
        <body>
                <textarea name="content" id="editor">This is some sample content.</textarea>
                <script>
                        BalloonEditor
                                .create( document.querySelector( '#editor' ) )
                                .then( editor => {
                                        console.log( 'hello' );
                                        console.log( editor );
                                        console.log( editor.getData() );
                                } )
                                .catch( error => {
                                        console.error( error );
                                } );
                </script>
        </body>
</html>

Result in a browser:

screenshot 2019-03-04 at 17 48 49

Expected result

  1. BalloonEditor.create() documentation could mention if there are any limitations on what can be passed as sourceElementOrData argument.

  2. The editor could log some meaningful error into the console when unsupported element is passed.

@wwalc wwalc added this to the iteration 23 milestone Mar 4, 2019
@Mgsy Mgsy added type:improvement This issue reports a possible enhancement of an existing feature. status:confirmed labels Mar 5, 2019
@Reinmar
Copy link
Member

Reinmar commented Mar 7, 2019

@Reinmar
Copy link
Member

Reinmar commented Mar 14, 2019

@wwalc, I know that it's you in https://stackoverflow.com/questions/55142625/creating-decouplededitor-passing-textarea-as-parameter :D I don't believe in such coincidences ;)

@vinkann
Copy link

vinkann commented Jul 21, 2020

Reached here with a google search. So CKEditor5 won't support if used with <textarea> tag is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants