Skip to content

Commit

Permalink
[FIX] sign_oca: Filter correctly next_items
Browse files Browse the repository at this point in the history
When we click 'Horizontal Tab' character we would expect to move the focus to the next item. Correctly filtering the next_items we will be able to do so.
  • Loading branch information
BernatPForgeFlow committed May 21, 2024
1 parent e2d243a commit b9af4de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sign_oca/static/src/elements/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ odoo.define("sign_oca.checkElement", function (require) {
ev.preventDefault();
var next_items = _.filter(
parent.info.items,
(i) => i.tabindex > item.tabindex && i.role_id === parent.role_id
(i) =>
i.tabindex > item.tabindex && i.role_id === parent.info.role_id
).sort((a, b) => a.tabindex - b.tabindex);
if (next_items.length > 0) {
ev.currentTarget.blur();
Expand Down
4 changes: 3 additions & 1 deletion sign_oca/static/src/elements/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ odoo.define("sign_oca.signatureElement", function (require) {
this.getParent().checkFilledAll();
var next_items = _.filter(
this.getParent().info.items,
(i) => i.tabindex > this.item.tabindex
(i) =>
i.tabindex > this.item.tabindex &&
i.role_id === this.getParent().info.role_id
).sort((a, b) => a.tabindex - b.tabindex);
if (next_items.length > 0) {
this.getParent().items[next_items[0].id].dispatchEvent(
Expand Down
3 changes: 2 additions & 1 deletion sign_oca/static/src/elements/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ odoo.define("sign_oca.textElement", function (require) {
ev.preventDefault();
var next_items = _.filter(
parent.info.items,
(i) => i.tabindex > item.tabindex && i.role_id === parent.role_id
(i) =>
i.tabindex > item.tabindex && i.role_id === parent.info.role_id
).sort((a, b) => a.tabindex - b.tabindex);
if (next_items.length > 0) {
ev.currentTarget.blur();
Expand Down

0 comments on commit b9af4de

Please sign in to comment.