diff --git a/src/plot.js b/src/plot.js
index 541218f306..628108bd65 100644
--- a/src/plot.js
+++ b/src/plot.js
@@ -332,6 +332,7 @@ export function plot(options = {}) {
if (subtitle != null) figure.append(createTitleElement(document, subtitle, "h3"));
figure.append(...legends, svg);
if (caption != null) figure.append(createFigcaption(document, caption));
+ if ("value" in svg) (figure.value = svg.value), delete svg.value;
}
figure.scale = exposeScales(scales.scales);
diff --git a/test/output/pointerViewofTitle.html b/test/output/pointerViewofTitle.html
new file mode 100644
index 0000000000..066b5f8008
--- /dev/null
+++ b/test/output/pointerViewofTitle.html
@@ -0,0 +1,406 @@
+
+
+ Penguins
+
+
+
\ No newline at end of file
diff --git a/test/plots/pointer.ts b/test/plots/pointer.ts
index 1e9df45067..e291a4c8f4 100644
--- a/test/plots/pointer.ts
+++ b/test/plots/pointer.ts
@@ -35,6 +35,16 @@ export async function pointerViewof() {
return html`${plot}${textarea}`;
}
+export async function pointerViewofTitle() {
+ const penguins = await d3.csv("data/penguins.csv", d3.autoType);
+ const plot = Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", tip: true}).plot({title: "Penguins"});
+ const textarea = html`