MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildTextControl

Function buildTextControl

packages/sdk-playground/src/main.ts:455–471  ·  view source on GitHub ↗
(
  row: HTMLElement,
  prop: string,
  currentVal: string,
  type: "text" | "number",
)

Source from the content-addressed store, hash-verified

453}
454
455function buildTextControl(
456 row: HTMLElement,
457 prop: string,
458 currentVal: string,
459 type: "text" | "number",
460) {
461 const input = document.createElement("input");
462 input.type = type;
463 input.className = "prop-input";
464 input.style.flex = "1";
465 input.value = currentVal;
466 input.addEventListener("blur", () => commitStyle(prop, input.value.trim() || null));
467 input.addEventListener("keydown", (e) => {
468 if (e.key === "Enter") input.blur();
469 });
470 row.appendChild(input);
471}
472
473function makeStyleRow(
474 label: string,

Callers 1

makeStyleRowFunction · 0.85

Calls 1

commitStyleFunction · 0.85

Tested by

no test coverage detected