| 344 | 345 | if (this.dlg != document.activeElement?.closest('.popup')) |
| 345 | 346 | return; |
| 346 | 347 | |
| 347 | 348 | // Check if the current focus is a result control. Only should we apply the compeletecomplete action |
| 348 | 349 | const resultControl = document.activeElement?.closest('.result-control'); |
| 349 | 350 | if (!resultControl) |
| 350 | 351 | return; |
| 351 | 352 | |
| 353 | + // Check if we are inside an input type text or a textarea field and send on enter is disabled |
| 354 | + const textarea = document.activeElement?.closest('textarea'); |
| 355 | + if (textarea instanceof HTMLTextAreaElement && !shouldSendOnEnter()) |
| 356 | + return; |
| 357 | + const input = document.activeElement?.closest('input[type="text"]'); |
| 358 | + if (input instanceof HTMLInputElement && !shouldSendOnEnter()) |
| 359 | + return; |
| 360 | + |
| 352 | 361 | evt.preventDefault(); |
| 353 | 362 | evt.stopPropagation(); |
| 354 | 363 | const result = Number(document.activeElement.getAttribute('data-result') ?? this.defaultResult); |