const controlBound = canvas.getBoundingClientRect();
      editContext.updateControlBounds(controlBound);

      // Render the text formats if any.
      if (textFormats.length) {
        for (const textFormat of textFormats) {
          renderUnderlineDecoration(textFormat);
        }
      }

      // Re-render on animation frame.
      rafID = requestAnimationFrame(render);
    }

    // Handle textupdate events.
    editContext.addEventListener("textupdate", e => {
      const text = e.text;

      sele