Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

OC-22077 Query widget appearing when clicking add repeat group button in form #738

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
OC-22077 Query widget appearing when clicking add repeat group button…
… in form(update)
  • Loading branch information
theywa committed Jan 29, 2024
commit eaaa71568f99bf6cbe656c8db864998296b88a50
11 changes: 6 additions & 5 deletions public/js/src/module/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,12 @@ Form.prototype.goToTarget = function (target, options = {}) {
// Focus on the first non .ignore form control which is not currently readonly.
// If the element is hidden (e.g. because it's been replaced by a widget),
// the focus event will not fire, so we also trigger an applyfocus event that widgets can listen for.
let selector =
'input:not(.ignore):not([readonly]), textarea:not(.ignore):not([readonly]), select:not(.ignore):not([readonly])';

// For repeat DOM, prevent focus on DN dome when all element is readonly or ignore(#733)
if (target.querySelector('.repeat-number')) {
let selector;
if (target.closest('.question')) {
selector =
'input:not(.ignore):not([readonly]), textarea:not(.ignore):not([readonly]), select:not(.ignore):not([readonly])';
} else {
// For repeat DOM, prevent focus on DN dome when all element is readonly or ignore(#733)
selector =
'.question:not(.or-appearance-dn) input:not(.ignore):not([readonly]), .question:not(.or-appearance-dn) textarea:not(.ignore):not([readonly]), .question:not(.or-appearance-dn) select:not(.ignore):not([readonly])';
}
Expand Down
Loading