Skip to content
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

Merged

Conversation

petrus-v
Copy link

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

@petrus-v
Copy link
Author

upstream PR

@ccomb
Copy link

ccomb commented Oct 19, 2015

👍

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'){
Copy link
Member

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.

@StefanRijnhart
Copy link
Member

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.

@petrus-v
Copy link
Author

@StefanRijnhart ,

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 <input type="text" />: https://github.com/OCA/OCB/blob/9.0/addons/web/static/src/js/views/list_view_editable.js#L380

@StefanRijnhart
Copy link
Member

Thanks for the update and your research into later versions! 👍

@pedrobaeza
Copy link
Member

A squash on both PRs can help to maintain OCB/Odoo possible differences

@petrus-v
Copy link
Author

@pedrobaeza

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.

@pedrobaeza
Copy link
Member

I mean to join the 3 commits in one. This is called squashing in git nomenclature. Do you know how to do it?

@petrus-v
Copy link
Author

@pedrobaeza ,

No I don't, I'm going to read the doc, thanks ;)

@pedrobaeza
Copy link
Member

Some hints: git rebase -i HEAD-3 (because you have 3 commits)

Then, on the editor, mark the lines of the last 2 commits with s or squash and save for merging all changes in one commit. You'll have to confirm the commit message for this "joined" commit.

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)
@petrus-v petrus-v force-pushed the 7.0-fix_9053-checkboxe-focus-when-editable branch from 6dc0709 to 27254af Compare October 21, 2015 09:01
@petrus-v
Copy link
Author

Thanks @pedrobaeza, squash done!

@pedrobaeza
Copy link
Member

👍

StefanRijnhart added a commit that referenced this pull request Nov 17, 2015
…-editable

[FIX] odoo#9035: on list view editable, set focus to input
@StefanRijnhart StefanRijnhart merged commit 5098fe2 into OCA:7.0 Nov 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants