import create_proxy and to_js from pyodide.ffi (#725)

This commit is contained in:
Madhur Tandon
2022-08-26 01:41:18 +05:30
committed by GitHub
parent 0f50f4a9fd
commit edfd4baa1f
8 changed files with 10 additions and 11 deletions

View File

@@ -227,7 +227,7 @@ async function createElementsWithEventListeners(runtime: Runtime, pyAttribute: s
const handlerCode = el.getAttribute(pyAttribute);
const event = pyAttributeToEvent.get(pyAttribute);
const source = `
from pyodide import create_proxy
from pyodide.ffi import create_proxy
Element("${el.id}").element.addEventListener("${event}", create_proxy(${handlerCode}))
`;
await runtime.run(source);