Skip to content
Snippets Groups Projects
Commit 57041f7e authored by Christophe Matthieu's avatar Christophe Matthieu Committed by qsm-odoo
Browse files

[FIX] web_tour: properly determine consume event for no-type inputs

When checking the consume type of an input element, the type attribute
was checked. Indeed a "text" input has a "input" consume event, while
a "button" input has a "mousedown" consume event. The problem here was
that when the input has no type, the "mousedown" consume event was
chosen while the default type for input is "text" for browsers.
parent 6b027582
No related branches found
No related tags found
No related merge requests found
......@@ -263,7 +263,8 @@ var Tip = Widget.extend({
Tip.getConsumeEventType = function ($element) {
if ($element.is("textarea") || $element.filter("input").is(function () {
return !!$(this).attr("type").match(/^(email|number|password|search|tel|text|url)$/);
var type = $(this).attr("type");
return !type || !!type.match(/^(email|number|password|search|tel|text|url)$/);
})) {
return "input";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment