Fix options added twice in form edition #1396

This commit is contained in:
yflory 2024-01-30 11:57:09 +01:00
parent 6f111f1d2e
commit f0cc3f0947

View File

@ -365,7 +365,7 @@ define([
});
if (!v.type || v.type === "text") {
$input.keyup(function (e) {
$input.keydown(function (e) {
try {
if (e.which === 13) {
var $line = $input.closest('.cp-form-edit-block-input');
@ -572,7 +572,8 @@ define([
}
// "Add option" button handler
$add = $(add).click(function () {
$add = $(add);
Util.onClickEnter($add, function () {
var txt = v.type ? '' : Messages.form_newOption;
var el = getOption(txt, true, false, Util.uid());
$add.before(el);