[FIX] point_of_sale: do not select payment input when hidden

Edge >=12 throws an error (code 800a025e) when calling the select()
method on an input element that is not currently part of document and
has a non-empty value.

When adding a paymentline a "change:selected_paymentline" event gets
triggered which in turn triggers the focus_selected_line function before
the actual paymentline gets rendered.

opw-671426
This commit is contained in:
Joren Van Onder 2016-03-08 16:18:17 +01:00
parent 906bf16a76
commit 591d74becf
1 changed files with 6 additions and 1 deletions

View File

@ -1179,7 +1179,12 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
input.value = '';
}else{
input.value = value;
input.select();
// Microsoft Edge >= 12 crashes (code 800a025e) when calling
// select on a non-empty input element not part of document
if (! this.hidden) {
input.select();
}
}
}
},