I recently encountered a similar issue.
After some investigation, I found that the problem was caused by Coral 3's Nested Multifield — when clicking the Add button, it triggers a duplicate focus event, which causes the page to scroll to the wrong position.
To fix this, I chose to override the native _onAddItemClick method, which successfully resolved the scrolling issue.
Below is the code I used. Please note that this script must be loaded after the categories coralui3 library is fully loaded.
Hope this helps!
(function () {
'use strict';
Coral.Multifield.prototype._onAddItemClick = function (event) {
var parent = event.target.closest("coral-multifield");
if (parent && parent === this) {
event.stopPropagation();
this.items.add(new Coral.Multifield.Item);
this.trigger("change");
this._trackEvent("click", "add item button", event);
var addBtn = event.target;
var items = this.items.getAll();
var setsize = items.length;
var itemToFocus = items[setsize - 1];
window.requestAnimationFrame(function () {
var focusableItem = itemToFocus.querySelector(Coral.commons.TABBABLE_ELEMENT_SELECTOR);
if (focusableItem.hasAttribute("disabled"))
addBtn.focus();
else
focusableItem.focus()
});
}
};
}());