Skip to content

Instantly share code, notes, and snippets.

@beckyresler
Created January 9, 2019 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beckyresler/63f5a95d45df45b6feff2508dd350e4d to your computer and use it in GitHub Desktop.
Save beckyresler/63f5a95d45df45b6feff2508dd350e4d to your computer and use it in GitHub Desktop.
WP eSignature Plugin - Fix for line breaks in textareas
(function ($) {
$(document).ready(function () {
makeSignatureKeyboardAccessible();
});
function makeSignatureKeyboardAccessible() {
var signaturePopup = $('.signature-wrapper-displayonly');
if (signaturePopup) {
signaturePopup.attr('tabindex', 0);
}
$(document).on('keypress', signaturePopup, function (e) {
var code = e.keyCode || e.which;
var tag = e.target.tagName.toLowerCase();
if (code == 13 && tag != 'textarea') {
signaturePopup.click();
}
});
}
})(jQuery);
@beckyresler
Copy link
Author

I added line 17 in the above code and modified line 19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment