mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Auto-generate element ID to ensure output is rendered
This commit is contained in:
@@ -144,9 +144,8 @@ export class PyScript extends BaseEvalElement {
|
||||
this.id = `pyid-${Date.now()}`
|
||||
}
|
||||
this.outputElement = document.createElement('div');
|
||||
// this.outputElement.classList.add("output");
|
||||
this.outputElement.hidden = true;
|
||||
this.outputElement.id = this.id + "-" + this.childElementCount;
|
||||
const exec_id = this.getAttribute("exec-id");
|
||||
this.outputElement.id = this.id + (exec_id ? "-"+exec_id : "");
|
||||
|
||||
// add the output div id if there's not output pre-defined
|
||||
mainDiv.appendChild(this.outputElement);
|
||||
|
||||
Reference in New Issue
Block a user