Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Inline editors do not work #41

Closed
jonrimmer opened this issue Aug 22, 2013 · 19 comments
Closed

Inline editors do not work #41

jonrimmer opened this issue Aug 22, 2013 · 19 comments
Assignees

Comments

@jonrimmer
Copy link

When TinyMCE is configured to appear in "inline" mode, via the inline: true configuration option, then text entry does not work properly. With a textarea element, the text disappears, whereas with divs, the caret is repeatedly moved to the beginning of the content, resulting a kind of backwards-writing effect. See this plunkr for a demonstration (happens in Chrome and Firefox).

http://plnkr.co/edit/w86QRKvuTAJKd9TZvR9a?p=preview

@gunnarlium
Copy link

I came across this same issue when trying to find a work-around for #38. I ended up creating a new version of the directive, specifically for inline editors.

It's in my own fork of this repo: https://github.com/gunnarlium/ui-tinymce/blob/inline-editor-version/src/tinymce-inline.js.

It's really just a quick and dirty effort to get something that solves my immediate problem, but if there's any interest, I'd be happy to collaborate to create something that can me merged into the main repo.

@rpCal
Copy link

rpCal commented Oct 20, 2014

The problem is with 51 line. Editor is saved after keyup event. This update cursor position. I dont know how to property fix but i know when i change code to this:

// Update model on keypress
ed.on('KeyUp', function (e) {
  if(!options.inline){
    ed.save();
  }
  updateView();
});

It work quite well.
Maybe someone have good solution?

@wesleycho
Copy link
Contributor

This should be fixed via cafdfa7

@SafinRR
Copy link

SafinRR commented Dec 2, 2015

Hello!
I find trouble with inline again.
text shows as raw

@deeg
Copy link
Contributor

deeg commented Dec 2, 2015

What version of the library are you using?

Can you please post a plunker showing your example with the issue?

@artttj
Copy link

artttj commented Dec 3, 2015

Want to say that we have the same trouble only in Firefox.

@deeg
Copy link
Contributor

deeg commented Dec 3, 2015

What version of the library are you using?

Can you please post a plunker showing your example with the issue?

@aske-cph
Copy link

aske-cph commented Dec 8, 2015

I have the same problem.

angular-ui-tinymce doesn't work on textareas. Text shows as raw. Cant edit anything. But the menu does show up:

on osx with:

Safari
Chrome
Firefox

versions:
Angular Ui Tinymce - 0.0.11
Tinymce 4.3.1

@deeg
Copy link
Contributor

deeg commented Dec 8, 2015

Can you please post a plunker demonstrating the issue so we can look into fixing it?

@aske-cph
Copy link

aske-cph commented Dec 8, 2015

http://plnkr.co/edit/10H6rbwP3xycbb493F9B?p=preview

Plunkr with newest versions:

Angular Ui Tinymce - 0.0.11
Tinymce 4.3.1

As you see, the textarea doesn't parse the text and you cant edit.

@re-gor
Copy link

re-gor commented Dec 10, 2015

I have the same problem in Chrome. I use last versions of angular-ui-tinymce and tinymce.
Noted that if I holding left mouse button on textarea I can print something. While I am printing this way error occurs in console log:

Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context.
http://errors.angularjs.org/1.4.7/$sce/unsafe
at http://localhost:3001/bower_components/angular/angular.js:68:12
at htmlSanitizer (http://localhost:3001/bower_components/angular/angular.js:16673:13)
at getTrusted (http://localhost:3001/bower_components/angular/angular.js:16837:16)
at Object.sce.(anonymous function) as getTrustedHtml
at Array. (http://localhost:3001/bower_components/angular-ui-tinymce/src/tinymce.js:121:35)
at $$parseAndValidate (http://localhost:3001/bower_components/angular/angular.js:25256:38)
at $commitViewValue (http://localhost:3001/bower_components/angular/angular.js:25246:10)
at http://localhost:3001/bower_components/angular/angular.js:25389:14
at Scope.$eval (http://localhost:3001/bower_components/angular/angular.js:15989:28)
at Scope.$apply (http://localhost:3001/bower_components/angular/angular.js:16089:25)

@aske-cph
Copy link

Any news on the problems?

Otherwise inline seems broken in all browsers with the current versions.
And this issue should be reopened, no?

@deeg
Copy link
Contributor

deeg commented Dec 14, 2015

Sorry for the delay. I am going to look into it this week. I am going to re-open the issue for now.

@deeg deeg reopened this Dec 14, 2015
@deeg deeg self-assigned this Dec 14, 2015
@deeg deeg added the bug label Dec 14, 2015
@deeg
Copy link
Contributor

deeg commented Dec 20, 2015

Changing the textarea to a div in your example, everything works fine.

Their documentation states:

Most common TinyMCE integrations use the editor in its classic form-based mode. In this integration mode the editor usage is as a form field that is filled out to provide content. The editor is always visible as part of the form to be edited.

Inline editing mode blends the editable view with the readable view of the page. Elements are replaced inline with an editor once clicked rather than the editor always being visible.

Most significantly, when using inline editing TinyMCE is not isolated from the page by virtue of being encapsulated within an iframe. This has the advantage of ensuring that the content within the editor inherits the surrounding page's styles when presenting the content.

Since the editor is not sandboxed in an iframe in inline editing mode, CSS styles for the editor's content will be inherited from the page that the editor is on. This allows you to edit content exactly as it appears within the context of the page, providing a true WYSIWYG editing experience.

Is there any reason you want to use a textarea instead of a div in this situation? You will see their example also does not use a textarea. I think you will find this issue has more to do with the TinyMCE library itself, rather than the angular wrapper.

@iJungleboy
Copy link

I'm new to tinymce and this module but got inline to work within minutes. Textarea should never work as inline, that is "the wrong way to do things" as inline should keep the original tag (textarea) and textarea doesn't support formating.

Here's a screenshot of successful integration in 2sxc from yesterday when I just got started

image

...so I would close this issue

@deeg deeg removed the bug label Jan 6, 2016
@deeg deeg closed this as completed Jan 6, 2016
@dfabreguette
Copy link

Hi !
Looks like I have the exact same origin problem in inline mode.
When I type in my cursor moves to the beginning of the line. like @jonrimmer @gunnarlium.
Any idea ?

@dfabreguette
Copy link

My bad, I was using on the same element "ng-bind-html".

@mtutty
Copy link

mtutty commented Feb 3, 2017

Sorry, we're still seeing it fail. The $scope var is not updated, even though it does initially bind from the ng-model var.

Try changing the content in the first editor tab. The p below is bound to the same scope var, and the button shows the scope var. Neither of these shows the right value after changing the bound tinymce div.

http://codepen.io/mtutty/pen/NdMyBv

@TOuhrouche
Copy link

Same issue here, the caret keeps going to the beginning of the line. Tried both Div and Text area, still the same :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests