@pyscript/core 0.7.20 → 0.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -388,8 +388,7 @@ const init = async (script, type, interpreter) => {
388
388
  };
389
389
 
390
390
  if (isSetup) {
391
- await context.handleEvent({ currentTarget: null, script });
392
- notifyEditor();
391
+ context.handleEvent({ currentTarget: null, script }).then(notifyEditor);
393
392
  return;
394
393
  }
395
394
 
@@ -419,7 +418,10 @@ const init = async (script, type, interpreter) => {
419
418
  // avoid inheriting styles from the outer component
420
419
  const styles = [':host { all: initial; }'];
421
420
  const rows = script.getAttribute("rows");
422
- if (rows) styles.push(`.cm-editor { height: auto; max-height: ${parseInt(rows) * 18}px; }`);
421
+ if (rows) {
422
+ const maxHeight = Math.floor(parseInt(rows) * 18.5) + 'px';
423
+ styles.push(`.cm-editor { height: auto; max-height: ${maxHeight}; }`);
424
+ }
423
425
  parent.innerHTML = `<style>${styles.join("\n")}</style>`;
424
426
 
425
427
  target.appendChild(boxDiv);