Do not expect a specific markup structure but use querySelector() to locate
the input element.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
o.renderWidget = function(/* ... */) {
var node = form.Value.prototype.renderWidget.apply(this, arguments);
- node.childNodes[1].addEventListener('keydown', function(ev) {
+ node.querySelector('input').addEventListener('keydown', function(ev) {
if (ev.keyCode == 13 && !ev.currentTarget.classList.contains('cbi-input-invalid'))
document.querySelector('.cbi-button-save').click();
});