Fix some more validation bugs

- Fix error if widget did not have a feedback slot or a '#help-text' element
- Fix copy/paste error scrolling to wrong widget
This commit is contained in:
nathan 2022-09-22 11:43:29 -06:00
parent 5a8f7c3c70
commit 4454f350b2
2 changed files with 8 additions and 3 deletions

View File

@ -444,11 +444,16 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
{
feedback.slot = "feedback";
}
else
else if(<HTMLElement>this.shadowRoot.querySelector("#help-text"))
{
// Not always visible?
(<HTMLElement>this.shadowRoot.querySelector("#help-text")).style.display = "initial";
}
else
{
// No place to show the validation error. That's a widget problem, but we'll show it as message
this.egw().message(feedback.textContent, "error");
}
}
});

View File

@ -1100,9 +1100,9 @@ export class etemplate2
(<Et2Tabs><unknown>tmpWidget).activateTab(invalid_widgets[0]);
}
// scroll the widget into view
if(typeof widget.scrollIntoView === 'function')
if(typeof tmpWidget.scrollIntoView === 'function')
{
widget.scrollIntoView();
tmpWidget.scrollIntoView();
}
}
else