( row: HTMLElement, prop: string, currentVal: string, type: "text" | "number", )
| 453 | } |
| 454 | |
| 455 | function 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 | |
| 473 | function makeStyleRow( |
| 474 | label: string, |
no test coverage detected