Skip to content

Instantly share code, notes, and snippets.

@susemeee
Last active December 27, 2017 05:12
Show Gist options
  • Save susemeee/1a83d8361975226f9fb71f915d325a00 to your computer and use it in GitHub Desktop.
Save susemeee/1a83d8361975226f9fb71f915d325a00 to your computer and use it in GitHub Desktop.
Enhancement of handling a data binding of angular.js (related to Korean IME composition event)
// angular.module('YOUR_APP').directive('koreanInput', KoreanInputDirective);
// SEE: https://github.com/angular/angular.js/issues/13617
export default function KoreanInputDirective () {
return {
restrict: 'A',
link: {
post: function (scope, element, attrs) {
element.on('compositionupdate', function (e) {
element.triggerHandler('compositionend');
});
},
},
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment