fix: claviature height

+ better defaults
+ break out solid web component creation
This commit is contained in:
Felix Roos 2024-03-15 11:04:35 +01:00
parent 4a95bf67da
commit dfd22b5e44
3 changed files with 25 additions and 13 deletions

View file

@ -0,0 +1,13 @@
import { setWidget } from '@strudel/codemirror';
export function getSolidWidget(type, id, options) {
let el = document.getElementById(id);
if (!el) {
el = document.createElement('div');
const c = document.createElement(type);
el.appendChild(c);
}
el.height = options.height || 200;
setWidget(id, el);
return el?.firstChild;
}