embed duplicates viewof select to show values; different from editor
Describe the bug When I create a selection input in editor mode, I see only the selection. In the embed mode, the variable is duplicated
To Reproduce Steps to reproduce the behavior: View this as embedded: https://observablehq.com/d/075a638054c366e7 https://observablehq.com/embed/075a638054c366e7
Expected behavior I expect just the input
Screenshots

Desktop (please complete the following information):
- OS: Windows 11
- Browser Chrome
- Version 103.0.5060.114 (Official Build) (64-bit)
Yeah, the issue here is that the embed code is observing everything in the notebook. If you look at the compiled source of the notebook (https://api.observablehq.com/d/075a638054c366e7.js?v=3) you’ll see that both viewof variable and variable are observable:
export default function define(runtime, observer) {
const main = runtime.module();
main.variable(observer()).define(["md"], _1);
main.variable(observer("viewof variable")).define("viewof variable", ["Inputs"], _variable);
main.variable(observer("variable")).define("variable", ["Generators", "viewof variable"], (G, _) => G.input(_));
return main;
}
The embed code will need to have some logic in that says to not observe variable if viewof variable is already observed.
As a workaround, you can select just the cells you want to embed rather than the entire notebook.