implement more intuitive keyboard controls for the tag prompt

pull/1/head
ansuz 5 years ago
parent 154a0b1e6e
commit b419ead7fe

@ -377,6 +377,14 @@ define([
field.focus(); field.focus();
}); });
var $field = field.tokenfield.closest('.tokenfield').find('.token-input');
$field.on('keypress', function (e) {
if (!$field.val() && e.which === 13) { return void $ok.click(); }
});
$field.on('keydown', function (e) {
if (!$field.val() && e.which === 27) { return void $cancel.click(); }
});
return tagger; return tagger;
}; };

Loading…
Cancel
Save