Skip to content

Commit

Permalink
RA-2047 - Registration app personAddressWithHierarchy does not naviga…
Browse files Browse the repository at this point in the history
…te correctly when there are no free-text levels (#144)
  • Loading branch information
mseaton authored Sep 30, 2024
1 parent aa5383d commit ba36fc3
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,27 +318,32 @@ function PersonAddressWithHierarchy(personAddressWithHierarchy) {
});
_.each(ui.item.data, function (value, key) {
setValue(key, value);
if (typeof (NavigatorController) != 'undefined') {
NavigatorController.stepForward();
}
});

// go to the first level we didn't just set
// go to the first level we didn't just set if there is one defined
var goToLevel = firstLevelNotIncluded(ui.item.data);
//this will disable next mandatory levels if no entries are configured in the system
preloadLevels(goToLevel);
if (goToLevel) {
//this will disable next mandatory levels if no entries are configured in the system
preloadLevels(goToLevel);

// if we are using the simple UI navigator, use the NavigatorController so that the simple for UI keeps up
if (typeof(NavigatorController) != 'undefined') {
var field = NavigatorController.getFieldById(personAddressWithHierarchy.id + '-' + goToLevel.addressField);
setTimeout(function () {
var oldField = selectedModel(NavigatorController.getFields());
if (oldField) {
oldField.toggleSelection();
}
field.select();
});
}
// otherwise just jump manually
else {
getInputElementFor(goToLevel.addressField).focus();
// if we are using the simple UI navigator, use the NavigatorController so that the simple for UI keeps up
if (typeof (NavigatorController) != 'undefined') {
var field = NavigatorController.getFieldById(personAddressWithHierarchy.id + '-' + goToLevel.addressField);
setTimeout(function () {
var oldField = selectedModel(NavigatorController.getFields());
if (oldField) {
oldField.toggleSelection();
}
field.select();
});
}
// otherwise just jump manually
else {
getInputElementFor(goToLevel.addressField).focus();
}
}
},
change: function (event, ui) {
Expand Down

0 comments on commit ba36fc3

Please sign in to comment.