mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
[FIX] output management cleanups (#464)
* return on \n before empty div is appended * use appendOutput with out.write * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Mariano Weber <info@uiremotely.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -152,7 +152,7 @@ export class BaseEvalElement extends HTMLElement {
|
||||
Element = pyodide.globals.get('Element');
|
||||
}
|
||||
const out = Element(this.outputElement.id);
|
||||
out.write.callKwargs(output, { append: true });
|
||||
out.write.callKwargs(output, { append: this.appendOutput });
|
||||
|
||||
this.outputElement.hidden = false;
|
||||
this.outputElement.style.display = 'block';
|
||||
@@ -179,7 +179,7 @@ export class BaseEvalElement extends HTMLElement {
|
||||
const out = Element(this.errorElement.id);
|
||||
|
||||
addClasses(this.errorElement, ['bg-red-200', 'p-2']);
|
||||
out.write.callKwargs(err, { append: true });
|
||||
out.write.callKwargs(err, { append: this.appendOutput });
|
||||
|
||||
this.errorElement.children[this.errorElement.children.length - 1].setAttribute('error', '');
|
||||
this.errorElement.hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user