Giter Club home page Giter Club logo

angular-trix's Introduction

license travis bower npm

angular-trix

A rich wysiwyg text editor directive for angularjs.

Angularjs directive for trix editor

angular-trix Demo

Angular-trix demo. Plunker demo

Install

You can get it on npm.

npm install angular-trix --save

Or bower, too.

bower install angular-trix --save

If you're not into package management, just download a ZIP file.

Setup

First, include angularjs, trix.js and trix.css into your document.

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/trix/0.9.2/trix.css">

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/trix/0.9.2/trix.js"></script>

trix.css includes default styles for the Trix toolbar, editor, and attachments. Skip this file if you prefer to define these styles yourself.

To use your own polyfills, or to target only browsers that support all of the required standards, include trix-core.js instead.

Then Include angular-trix.js.

<script src="dist/angular-trix.min.js"></script>

Add angularTrix dependency to your module

var myApp = angular.module('app', ['angularTrix']);

Create trix-editor

Place an empty <trix-editor></trix-editor> tag on the page. Trix will automatically insert a separate <trix-toolbar> before the editor.

Like an HTML <textarea>, <trix-editor> accepts autofocus and placeholder attributes. Unlike a <textarea>, <trix-editor> automatically expands vertically to fit its contents.

Finally, add angular-trix directive and ng-model to the <trix-editor></trix-editor>.

<trix-editor angular-trix ng-model="foo"></trix-editor>

Styling Formatted Content

To ensure what you see when you edit is what you see when you save, use a CSS class name to scope styles for Trix formatted content. Apply this class name to your <trix-editor> element, and to a containing element when you render stored Trix content for display in your application.

<trix-editor angular-trix ng-model="foo" class="trix-content"></trix-editor>

The default trix.css file includes styles for basic formatted content—including bulleted and numbered lists, code blocks, and block quotes—under the class name trix-content. We encourage you to use these styles as a starting point by copying them into your application’s CSS with a different class name.

Observing Editor Changes

The <trix-editor> element emits several events which you can use to observe and respond to changes in editor state.

  • trix-initialize fires when the <trix-editor> element is attached to the DOM and its editor object is ready for use.

  • trix-change fires whenever the editor’s contents have changed.

  • trix-selection-change fires any time the selected range changes in the editor.

  • trix-focus and trix-blur fire when the editor gains or loses focus, respectively.

  • trix-file-accept fires when a file is dropped or inserted into the editor. You can access the DOM File object through the file property on the event.

  • trix-attachment-add fires after an attachment is added to the document. You can access the Trix attachment object through the attachment property on the event. If the attachment object has a file property, you should store this file remotely and set the attachment’s URL attribute.

  • trix-attachment-remove fires when an attachment is removed from the document. You can access the Trix attachment object through the attachment property on the event. You may wish to use this event to clean up remotely stored files.

You can use the following attributes to listen the trix events and implement your custom logic. You can access trix event and editor instance parameters in controller.

  • trix-initialize
  • trix-change
  • trix-selection-change
  • trix-focus
  • trix-blur
  • trix-file-accept
  • trix-attachment-add
  • trix-attachment-remove
<trix-editor ng-model="trix" angular-trix trix-initialize="trixInitialize(e, editor);" trix-change="trixChange(e, editor);" trix-selection-change="trixSelectionChange(e, editor);" trix-focus="trixFocus(e, editor);" trix-blur="trixBlur(e, editor);" trix-file-accept="trixFileAccept(e, editor);" trix-attachment-add="trixAttachmentAdd(e, editor);" trix-attachment-remove="trixAttachmentRemove(e, editor);"></trix-editor>
// You can still access the trix event
var events = ['trixInitialize', 'trixChange', 'trixSelectionChange', 'trixFocus', 'trixBlur', 'trixFileAccept', 'trixAttachmentAdd', 'trixAttachmentRemove'];

for (var i = 0; i < events.length; i++) {
    $scope[events[i]] = function(e, editor) {
        console.info('Event type:', e.type);
    }
};

For a live demonstration, open this site and just your console :)

Storing Attached Files

Trix automatically accepts files dragged or pasted into an editor and inserts them as attachments in the document. Each attachment is considered pending until you store it remotely and provide Trix with a permanent URL.

To store attachments, listen for the trix-attachment-add event. Upload the attached files with XMLHttpRequest yourself and set the attachment’s URL attribute upon completion. See the Plunker for detailed information.

If you don’t want to accept dropped or pasted files, addprevent-trix-file-accept = "true" attribute to the trix editor.

Editing Text Programmatically

You can manipulate a Trix editor programmatically through the Trix.Editor interface, available on each <trix-editor> element through its editor property. You can access editor property in controller via trix event parameter.

<trix-editor angular-trix ng-model="foo" trix-initialize="trixInitialize(e, editor);"></trix-editor>
// Controller 
// @e trix event
// @editor Trix.Editor instance
$scope.trixInitialize = function(e, editor) {}

Understanding the Document Model

The formatted content of a Trix editor is known as a document, and is represented as an instance of the Trix.Document class. To get the editor’s current document, use the editor.getDocument method.

$scope.trixInitialize = function(e, editor) {
	editor.getDocument()  // is a Trix.Document instance
}

You can convert a document to an unformatted JavaScript string with the document.toString method.

$scope.trixInitialize = function(e, editor) {
	var document = editor.getDocument()
	document.toString()  // is a JavaScript string
}

Getting and Setting the Selection

Trix documents are structured as sequences of individually addressable characters. The index of one character in a document is called a position, and a start and end position together make up a range.

To get the editor’s current selection, use the editor.getSelectedRange method, which returns a two-element array containing the start and end positions.

$scope.trixInitialize = function(e, editor) {
	editor.getSelectedRange()  // [0, 0]
}

You can set the editor’s current selection by passing a range array to the editor.setSelectedRange method.

$scope.trixInitialize = function(e, editor) {
	// Select the first character in the document
	editor.setSelectedRange([0, 1])
}

Collapsed Selections

When the start and end positions of a range are equal, the range is said to be collapsed. In the editor, a collapsed selection appears as a blinking cursor rather than a highlighted span of text.

For convenience, the following calls to setSelectedRange are equivalent when working with collapsed selections:

$scope.trixInitialize = function(e, editor) {
	editor.setSelectedRange(1)
	editor.setSelectedRange([1])
	editor.setSelectedRange([1, 1])
}

Directional Movement

To programmatically move the cursor or selection through the document, call the editor.moveCursorInDirection or editor.expandSelectionInDirection methods with a direction argument. The direction can be either "forward" or "backward".

$scope.trixInitialize = function(e, editor) {
	// Move the cursor backward one character
	editor.moveCursorInDirection("backward")
	
	// Expand the end of the selection forward by one character
	editor.expandSelectionInDirection("forward")
}

Converting Positions to Pixel Offsets

Sometimes you need to know the x and y coordinates of a character at a given position in the editor. For example, you might want to absolutely position a pop-up menu element below the editor’s cursor.

Call the editor.getClientRectAtPosition method with a position argument to get a DOMRect instance representing the left and top offsets, width, and height of the character at the given position.

$scope.trixInitialize = function(e, editor) {
	var rect = editor.getClientRectAtPosition(0)
	[rect.left, rect.top]  // [17, 49]
}

Inserting and Deleting Text

The editor interface provides methods for inserting, replacing, and deleting text at the current selection.

To insert or replace text, begin by setting the selected range, then call one of the insertion methods below. Trix will first remove any selected text, then insert the new text at the start position of the selected range.

Inserting Plain Text

To insert unformatted text into the document, call the editor.insertString method.

$scope.trixInitialize = function(e, editor) {

	// Insert “Hello” at the beginning of the document
	editor.setSelectedRange([0, 0])
	editor.insertString("Hello")
}

Inserting HTML

To insert HTML into the document, call the editor.insertHTML method. Trix will first convert the HTML into its internal document model. During this conversion, any formatting that cannot be represented in a Trix document will be lost.

$scope.trixInitialize = function(e, editor) {

	// Insert a bold “Hello” at the beginning of the document
	editor.setSelectedRange([0, 0])
	editor.insertHTML("<strong>Hello</strong>")
}

Inserting a File

To insert a DOM File object into the document, call the editor.insertFile method. Trix will insert a pending attachment for the file as if you had dragged and dropped it onto the editor.

$scope.trixInitialize = function(e, editor) {

	// Insert the selected file from the first file input element
	var file = document.querySelector("input[type=file]").file
	editor.insertFile(file)
}

Inserting a Line Break

To insert a line break, call the editor.insertLineBreak method, which is functionally equivalent to pressing the return key.

$scope.trixInitialize = function(e, editor) {

	// Insert “Hello\n”
	editor.insertString("Hello")
	editor.insertLineBreak()
}

Deleting Text

If the current selection is collapsed, you can simulate deleting text before or after the cursor with the editor.deleteInDirection method.

$scope.trixInitialize = function(e, editor) {

	// “Backspace” the first character in the document
	editor.setSelectedRange([1, 1])
	editor.deleteInDirection("backward")
	
	// Delete the second character in the document
	editor.setSelectedRange([1, 1])
	editor.deleteInDirection("forward")
}

To delete a range of text, first set the selected range, then call editor.deleteInDirection with either direction as the argument.

$scope.trixInitialize = function(e, editor) {

	// Delete the first five characters
	editor.setSelectedRange([0, 4])
	editor.deleteInDirection("forward")
}

Working With Attributes and Indentation

Trix represents formatting as sets of attributes applied across ranges of a document.

By default, Trix supports the inline attributes bold, italic, href, and strike, and the block-level attributes quote, code, bullet, and number.

Applying Formatting

To apply formatting to the current selection, use the editor.activateAttribute method.

$scope.trixInitialize = function(e, editor) {
	editor.insertString("Hello")
	editor.setSelectedRange([0, 5])
	editor.activateAttribute("bold")
}

To set the href attribute, pass a URL as the second argument to editor.activateAttribute.

$scope.trixInitialize = function(e, editor) {
	editor.insertString("Trix")
	editor.setSelectedRange([0, 4])
	editor.activateAttribute("href", "http://trix-editor.org/")
}

Removing Formatting

Use the editor.deactivateAttribute method to remove formatting from a selection.

$scope.trixInitialize = function(e, editor) {
	editor.setSelectedRange([2, 4])
	editor.deactivateAttribute("bold")
}

Formatting With a Collapsed Selection

If you activate or deactivate attributes when the selection is collapsed, your formatting changes will apply to the text inserted by any subsequent calls to editor.insertString.

$scope.trixInitialize = function(e, editor) {
	editor.activateAttribute("italic")
	editor.insertString("This is italic")
}

Adjusting the Indentation Level

To adjust the indentation level of block-level attributes, call the editor.increaseIndentationLevel and editor.decreaseIndentationLevel methods.

$scope.trixInitialize = function(e, editor) {
	editor.activateAttribute("quote")
	editor.increaseIndentationLevel()
	editor.decreaseIndentationLevel()
}

Using Undo and Redo

Trix editors support unlimited undo and redo. Successive typing and formatting changes are consolidated together at five-second intervals; all other input changes are recorded individually in undo history.

Call the editor.undo and editor.redo methods to perform an undo or redo operation.

$scope.trixInitialize = function(e, editor) {
	editor.undo()
	editor.redo()
}

Changes you make through the editor interface will not automatically record undo entries. You can save your own undo entries by calling the editor.recordUndoEntry method with a description argument.

$scope.trixInitialize = function(e, editor) {
	editor.insertString("Hello")
	editor.recordUndoEntry("Insert Text")
}

License

MIT License

angular-trix's People

Contributors

sachinchoolur avatar

Stargazers

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

Watchers

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

angular-trix's Issues

Drag and Drop Text into the editor

I would like to drag and drop (predetermined) text at the cursor location (not at the beginning) in the editor. This will be useful in creating templates using the editor. Is it possible?

All the examples, I saw use trixInitialize or other registered events but I did not see something like this in anyother text editor other than https://github.com/froala/angular-froala, which is subscription based.

Allow drag&drop without putting the attachment in the document

Hi, perhaps I'm not understanding something. I don't see a direct way that I would be able drag and drop a file over to the editor, for it to fire off the attachment-add method but not actually add the attachment in the document of the editor (inline). Is this possible?

Nothing is initialize [SOLVED]

Hello,

I'm want to use this impressive angular editor. So I installed angular-trix (with npm), included css and js files, and placed in my code, and finally loaded angularTrix module.

<trix-editor angular-trix ng-model="article.text"></trix-editor>

The problem is that I got this :

capture du 2016-05-18 00-03-29

Through the inspector I got this :
<trix-editor angular-trix="" ng-model="article.text" class="ng-pristine ng-untouched ng-valid ng-isolate-scope ng-not-empty"></trix-editor>

Did I miss something to initialize ?

Thanks for considering my problem, and sorry for grammar mistakes if there are.

Yoann

How to remove HTML tags when data is displayed from the database?

I am new using to angular trix. I am having some trouble in retrieving the data from the database. When I save the content from the editor to database it is saving fine but when I retrieve instead of the data what I saved, HTML tags are applying.

For example: in the editor if save Sample content as bold and when I reload the page after saving it is displayed as < div >< strong>Sample content< /strong>< /div> but I just need Sample content in bold. Please help me in fixing this issue.

how to retrieve html string from editor

to retrieve the text from the trix-editor the following is used
$scope.trixInitialize = function(e, editor) { editor.getDocument() // is a Trix.Document instance }
this returns the string of editor's content...
i would like to know to return the html string content of the editor
thanks

Remove Attachement?

Hii,

What i am trying to do is establish a maximum size for the attachements and block files that are bigger than the value chosen. Is there a way of stop the addition of the attachement or remove them?

feature sugestion

Hello. I'd like to suggest one feature: When i highlight some text could be fun if i can change the color selection.

Not showing model data when parent element has ng-if

Like this:

<div data-ng-if="showTrix">
    <trix-editor angular-trix ng-model="someModel"></trix-editor>
</div>

"someModel" is not show as content at all. I tried adding ng-if="true" to trix-editor but no luck there!

Any idea?

Binding not working on popup

I launch a modal (bootstrap) but the binding does not work.

If I put the binding in a div, I can see it is passed into modal however for the angular-trix component it does not appear.

My code is:

     $scope.editCommentDialog = function (comment) {
        var modalInstance = $modal.open({
            templateUrl: 'editCommentDialog.html',
            windowClass : 'edit-comment-modal-dialog',
            controller: function ($scope, $modalInstance, editedComment) {
                $scope.editedComment = editedComment;

                $scope.ok = function () {
                    $modalInstance.close(editedComment);
                };

                $scope.cancel = function () {
                    $modalInstance.dismiss('cancel');
                };
            },
            resolve: {
                editedComment: function () {
                   return { id : comment.id,  text : comment.text};
                }
            }
        });

        modalInstance.result.then(function (editedComment) {
            $scope.editedComment = editedComment;
            $scope.updateComment();
        }, function () {
            $log.info('Modal dismissed at: ' + new Date());
        });
    };

and

<script type="text/ng-template" id="editCommentDialog.html">
<div class="modal-header">
    <h3>Edit</h3>
</div>
<div class="modal-body">
    <trix-editor angular-trix ng-model="editedComment.text" class="trix-content editable-trix-editor"></trix-editor>
   </div>
   <div class="modal-footer">
    <button class="btn btn-primary" ng-click="ok()">OK</button>
    <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>
</script>

How do I get the contents of the editor?

I want to make it so that if the user presses the enter key without shift, it will not add a newline, but will instead call a submit kind of function on my controller. I have previously been using textangular, but they don't have events or really anything to make this easy for me, and there i was encountering a race condition with reading the content. to test angular-trix, i made a small fork of the plunkr, see: http://plnkr.co/edit/2qC9DZEI8eOxNW74pS7J?p=preview
(the plunkr is such that it will log $scope.trix after 5 seconds)
so to test: i have the console open on the side and refresh the plunkr. immediately start typing real words. while watching for the console. you will see it log at 5 seconds, and in my tests, this had only the beginning contents of the model. How would i get the current typed text?

Doesn't work at all

It doesn't work. Like, at all.

I've installed trix and angular-trix using bower. Works.
Then I included the scripts using requirejs. Works too.
Then I required the angularTrix requirejs-module. Works as well.
Then I required the angularTrix angular module. Still works fine.
Then I added this to my page:

<trix-editor angular-trix ng-model=foo></trix-editor>

Which doesn't do anything. It just renders in the DOM as:

<trix-editor angular-trix="" ng-model="foo" class="ng-pristine ng-untouched ng-valid ng-scope ng-isolate-scope ng-empty"></trix-editor>

So not much at all.

I get no errors in the console. No network errors. No security errors. Nothing.

Angular 1.6.4, Requirejs 2.3.3, Firefox 52 & Chrome 57.

Binding not working in directive

I have the following directive code and the ng-model does not work. I understand trix-change is not fired for this element. I tried ng-if, the model is now there but it has empty value and does not change.

<div class="chapter-title">
	 <trix-editor style="width:100%;" angular-trix placeholder="write here" ng-model="mydata" ng-model-options="{debounce: 1000}">
	 </trix-editor>
	<div>mydata:{{mydata}}</div>
</div>

Without ng-if, I see the following error:

angular.js:13920 TypeError: Cannot set property 'nodeValue' of undefined
at interpolateFnWatchAction (angular.js:9741)
at interpolateFnWatcher (angular.js:12426)
at watchGroupAction (angular.js:17190)
at Scope.$digest (angular.js:17524)
at Scope.$apply (angular.js:17790)
at done (angular.js:11831)
at completeRequest (angular.js:12033)
at XMLHttpRequest.requestLoaded (angular.js:11966)

How I customize the HTML attachment?

Is it possible to customize the attachment HTML? Instead of an image it could be an image icon like this:

<label class="attach" contenteditable="false"> <a class="blob icon-camera" href="" target="blank"> </a> </label>

Disabled or read-only state

I couldn't find any information (here or at original trix documentation) about making editor disabled or read-only state.
So i implemented like this:
angular.element(editor.element).prop('contenteditable', false); angular.element(editor.element.toolbarElement).remove();

Any better implementation idea or any information about doing this right way?

How to add table

How can I add table option in editor? because there is no option for table.

Comparison with Textangular & CKeditor

Hey Sachin

This looks really great!
Still, I have to ask:

What are the pros and cons of this "module" compared to Textangular and/or CKeditor?

Or what was the main motivation behind making a new one?

Don't get me wrong, it really looks promising and I will try it out. Since I use Textangular & CKeditor. Just would love to hear the author's voice ;)

How to add target _blank and responsive img attachment

#19

Had troubles rendering trix-content with target="_blank" for links and responsive images. This fixed it for me.

scope.$watch('content', function(html) {
                element.html(scope.content);
                $compile(element.contents())(scope);
                _.forEach(element.find('a'), function(el) {
                    el.target = '_blank';
                });
                _.forEach(element.find('img'), function(el) {
                    el.className = 'img-responsive';
                });
            }, true);

in a link function of a directive, where content is the html string from database:

<example-directive content="trix-html-content"></example-directive>

Error when install trix

Hi

When I tried to install trix and run. I have error.
npm install [email protected] --save-dev
npm WARN saveError Problems were encountered
npm WARN saveError Please correct and try again.
npm WARN saveError invalid: have [email protected] (expected: latest) node_modules/angular-trix/node_modules/trix
npm WARN saveError extraneous: [email protected] node_modules/angular-trix/node_modules/trix
/Users/project/***

I checked dependancy in angular-trix is lastest.
It seem we need to fix trix version instead of lastest?

insertHTML unwanted break / div

I want the editor to initialize as a bulleted list, but am having the following issue:
(note: I have the toolbar hidden since it takes up too much space for my uses)

  1. Inserting a ul
$scope.trixInitialize = function(e, editor) {
  editor.setSelectedRange([0,0]);
  editor.insertHTML('<ul><li></li></ul>');
}

results in a list followed by an empty div:
<ul><li><!--block--><br></li></ul><div><!--block--><br></div>

  1. I would expect the list to be inserted inside the div like insertString:
$scope.trixInitialize = function(e, editor) {
  editor.setSelectedRange([0,0]);
  editor.insertString('Hello World');
}

<div><!--block-->Hello World</div>

Am I missing something?

How to use trix in edit option?

Everything is ok but when i want to get stored text to edit with trix it doesn't working.
how can i get present text in editor mode?

Buttons for text-alignment?

Hello,

I hope you guys are doing great. I was wondering if I am missing out on this or does this feature need enabling or something, but is there any way to align text to center or right hand side?

Is it possible to edit the tool bar and add/remove features from it? I'm very sorry if its an obvious question, I googled and couldn't find any help and searched "issues" for "align" and it didn't get any response.

Any help in this regard will be highly appreciated.

Thank you all in advance.

can not put trix inside a modal (bootstrap)

i am trying to place a trix-editor in a bootstrap modal but for some reason the modal does not see it as part of the body and will render it in the footer not sure how to fix this

Required when using as a form input

When using angular-trix as an input for a from, I want to be able to put a required attribute so I can use the build-in form validation from HTML5 browsers.

Any idea how to implement this? I am happy to do it, but I cannot think of a neat and simple solution right now (checking if the ng-model is set could be a solution before submitting, but this seams not very solid.)

Not working in IE 10 or Less

It's not working in IE 10 or Less, t's continuously showing following error.

Unable to set property 'trixMutable' of undefined or null reference

Here is demo, open it in IE 10 or Less to see issue.

Trix-editor ng-model binding not working inside ui.bootstrap modal

Observing an extremely odd behavior while using angular-trix inside an ui.bootstrap modal. Inside modal html template if "trix-editor" element is wrapped inside a div then ng-model binding doesn't work, having said that it seems to be working fine if there is no parent div. Please take a look at plunker link for the same: http://plnkr.co/edit/C4BTOHLoXV55lXDJ1tKh?p=preview.

After putting debugger in angular-trix.js i could observe that inside following code blob:

ngModel.$render = function() {   
     if (element[0].editor) {
          element[0].editor.loadHTML(ngModel.$modelValue);
     }
....

value of element[0]:

  1. trix-editor when there is no parent div.
  2. trix-toolbar when there is parent div.

Probably this is the reason ng-model is not working inside div, not sure why element[0] would return different result inside bootstrap modal.

Weird angular-trix directive behavior when put inside ng-repeat.

I'm using angular-trix in one of my projects and recently I faced an weird problem where angular-trix doesn't work.

The problem is: I have an array of objects variable that is print in an template inside an ng-repeat, this ng-repeat calls an custom directive, that then calls trix-editor. For some reason, only if I put that custom directive in an ng-repeat logic the trix-editor is loaded, but it's content is not shown.

You can see the problem live in: http://plnkr.co/edit/sOk5GrFJuOwMNUQf8E7V?p=preview

if you just remove < directive-text > from the ng-repeat logic and replace member="member" to member="members[0]" the directive works!

HTML contains stray <!--block--> due to binding approach

The library currently takes the HTML of the editor and binds it to the Angular variable. This results in some internal Trix HTML comments being added to the HTML (<!--block--> - see below). A better way is to use Trix to serialize the editor state into HTML:

Replace: ngModel.$setViewValue(element.html()); with ngModel.$setViewValue(Trix.serializeToContentType(element[0], "text/html"))

The HTML output changes from this:

<div><!--block-->Test<br><br>Now works correctly!<br><br><strong>Bold</strong> and <em>great</em> once again.<br><br><strong><br></strong><br></div>

to the nicer:

<div>Test<br><br>Now works correctly!<br><br><strong>Bold</strong> and <em>great</em> once again.<br><br><strong><br></strong><br></div>

IE 11 issue with binding model

In IE11, deleting the last character does not update the model. You can try in your demo plunker.
Add the model to the plunker such as {{trix}}. This will print the model.
Enter a couple chars in textbox. Delete all but one character. Model will be one character. Delete last character, and the model does not update. element.on('trix-change).... does not fire for last char.

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.