Do not expect a specific markup structure but use querySelector() to locate
the input element.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit
34c06b4704383428c87e0a3c3c96ff7facfa5c46)
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();
});