Skip to content

Help with view() and Jeremy Ashkenas' Inputs in Framework #2003

Answered by mbostock
aaronkyle asked this question in Q&A
Discussion options

You must be logged in to vote

Jeremy’s Inputs relies on the unsafe behavior of the html tagged template literal in notebooks. When you switch it to using Hypertext Literal, you get the invalid binding error because it’s using forms of interpolation that Hypertext Literal doesn’t support. Specifically it comes from this part:

<select name="input" ${multiple ? `multiple size="${size || options.length}"` : ""}>

In Hypertext Literal, you have to rewrite this as:

<select name="input" multiple=${multiple} size=${multiple ? size || options.length : undefined}>

As you also discovered, you’ll probably also need to strip the whitespace around the <form> element; otherwise Hypertext Literal will wrap the form element with a DIV …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by aaronkyle
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants