max-mapper / yo-yo

A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

select element not registering event handlers?

bfulop opened this issue · comments

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?)

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

😅

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!