max-mapper / yo-yo

A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals
1.33k stars 65 forks source link

select element not registering event handlers? #72

Closed bfulop closed 7 years ago

bfulop commented 7 years ago

No matter how hard I try, I can only register event handlers for the onmouseover event with the <select> element. The other event types disappear once the element is rendered.

var html = require('yo-yo')

var logger = e => console.log(e)

html`
<select id="myselect" oninput="${logger}" onmouseover=${logger}>
     <option value="mono">Mono</otion>
     <option value="serif">Serif</otion>
</select>
`

Any ideas why this could be and how to get around this issue? (Other than adding the event listeners externally?)

shama commented 7 years ago

The attribute oninput="${logger}" should be unquoted: oninput=${logger}.

bfulop commented 7 years ago

😅

Sorry it's just one those times when you should just take break instead of mindlessly hitting the keyboard...

Thanks for the quick reply, saved my day!