fixes #2310 check whether there is a textarea when pressing enter

This commit is contained in:
Linty 2025-01-09 10:33:09 +01:00
parent 0cce9ef09d
commit 64064b5974

View file

@ -226,7 +226,9 @@ function selectDelDerivNone() {
// Trigger action click on pressing enter and if the value of applyAction is not equal to -1
$(window).on('keypress', function(e) {
if (e.key === "Enter" && $("select[name='selectAction']").val() != -1) {
const selected = $("select[name='selectAction']").val();
const haveTextarea = $(`#action_${selected} textarea`).length;
if (e.key === "Enter" && selected != -1 && !haveTextarea) {
e.preventDefault();
$('#applyAction').trigger('click');
}