New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] #9035: on list view editable, set focus to input #345
[FIX] #9035: on list view editable, set focus to input #345
Conversation
upstream PR |
👍 |
if (focus_field && fields[focus_field]){ | ||
var input = fields[focus_field].$el.find('input'); | ||
if(input[0] && input[0].type === 'text' || | ||
input[0].type === 'textarea'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like input[0].type === 'textarea' is still going to be evaluated even if input[0] is not defined, due to operator precedence:
$ false && false || true
true
Either this test is unnecessary, or you will want to use some parentheses.
Thanks. It would be nice to know about the status of 9.0 or master. Proposing onto these versions upstream would greatly improve the chance of having your work merged there. |
Thanks for review, obviously it was wrong!... Yes, I guess it's the same in v8 (I haven't test it): https://github.com/OCA/OCB/blob/8.0/addons/web/static/src/js/view_list_editable.js#L263 Things appears to change in v9, it works (tested), text is not selected anymore when getting focus on |
Thanks for the update and your research into later versions! 👍 |
A squash on both PRs can help to maintain OCB/Odoo possible differences |
What do you mean ? what is a "Squash" ? Do you mean, to let the information about concerned version on both PR? I've updated the issue odoo#9035 for that. |
I mean to join the 3 commits in one. This is called squashing in git nomenclature. Do you know how to do it? |
No I don't, I'm going to read the doc, thanks ;) |
Some hints: Then, on the editor, mark the lines of the last 2 commits with |
when type is different of 'text' or 'textarea' and this kind of field are at the first position. This happen when moving to the next editing line. In Qunit to test selected text, getSelection is not working as expected on Firefox (ffx 85686 issue)
6dc0709
to
27254af
Compare
Thanks @pedrobaeza, squash done! |
👍 |
…-editable [FIX] odoo#9035: on list view editable, set focus to input
type which are not in (text or textarea) when those kind of fields is in the first position
this occur when moving to the next editing line
see issue odoo#9035 to get more information to reproduce it