chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
555 stars 134 forks source link

In IE 11 the v-model is not updating #63

Open rclaretfx opened 6 years ago

rclaretfx commented 6 years ago

In IE 11, when entering text into the wysiwyg box, the corresponding v-model is not being updated.

arenier commented 6 years ago

I'm having the same issue

davidnoguerol commented 5 years ago

I'm also having this issue, can this be fixed?

Issue: This package uses <div contenteditable="true"></div> as the input field. IE doesn't respond to input events added to this div.

Solution: Change event name to textinput, it works in IE 11 for event attachment. Just be sure you let the other browsers use input.

kevteljeur commented 4 years ago

In case anyone comes here looking up this issue, here's a temporary fix that I employed (I know, it's dirty, but you know, IE and deadlines):

if ( self.isIE11() ) {
    jQuery( '.editr .editr--content' ).on( 'textinput', function ( event ) {
        let updatedContent = jQuery( event.target ).html();

        self.myData = updatedContent;
    } );
}

Yes, jQuery, which I'm using anyway, and that's the isIE11 mixin which is in use to capture routing event issues with Vue and IE. it's not the prettiest, but the rest of my code works without modification.