You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
This can be done with content-editable div. However, when a text is converted to html, the cursor position would change. This can be handled with rangy library.
A quick (and dirty) suggestion is placing an (absolute positioned) textarea (with transparent background) on top of an ng-embed and show/hide the ng-embed with ng-if (to trigger a redraw) (it's best to also change the text color of the textarea to transparent, but keep in mind that some browsers/platforms also change the cursor color to transparent in that case) based on user input (ie. 1s timeout to show and hide again on keydown/mousedown/input/etc)... The downside is you have to take care of spacing and height (otherwise the textarea would collapse to 0. I actually use a similar approach combined with a mirror <pre> element to autogrow my textarea whilst typing (up to a max height). The upside is that you don't have to fiddle around with contenteditable and the original text remains intact whilst typing (so you can change it in case a certain combination get's accidentally converted (maybe a :) combo)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I only see the ngEmbed is for show, how can i edit it's content like in html editor? for example, I want use it in a comment box, any help?
The text was updated successfully, but these errors were encountered: