mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-24 13:02:21 +00:00
fixed reg trunk validation cannot move tab and focus to missing fields
This commit is contained in:
@@ -921,6 +921,17 @@ export const CarrierForm = ({
|
||||
if (activeTab !== targetTab) {
|
||||
e.preventDefault(); // Stop the "not focusable" error
|
||||
setActiveTab(targetTab);
|
||||
|
||||
setTimeout(() => {
|
||||
const field =
|
||||
document.getElementById(fieldName) ||
|
||||
document.querySelector(`[name="${fieldName}"]`);
|
||||
if (field && field instanceof HTMLInputElement) {
|
||||
field.focus();
|
||||
field.scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
field.reportValidity();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user