mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-20 18:34:23 +00:00
fixed reg trunk validation cannot move tab and focus to missing fields
This commit is contained in:
1 parent
eff96bd32c
commit
a0dc97487b
1 file changed
+11
@@ -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