Skip to content
Snippets Groups Projects
Commit 2cef72a9 authored by Nicolas Bayet's avatar Nicolas Bayet
Browse files

[FIX] web_editor: properly select the command of powerbox


Before this commit
On mobile, clicking on a powerbox item called the first command.

After this commit
On mobile, clicking on a powerbox item call the clicked item command.

task-2751059

closes odoo/odoo#88059

X-original-commit: 03638e4d46941bb4751ac2d6df8c08cb4cc2208e
Signed-off-by: default avatarAntoine Guenet <age@odoo.com>
Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
parent 378e9de9
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ export class Powerbox {
ev => {
ev.preventDefault();
ev.stopImmediatePropagation();
this._currentValidate();
this._currentValidate(command);
},
true,
);
......@@ -254,10 +254,12 @@ export class Powerbox {
this.options.onStop && this.options.onStop();
};
this._currentValidate = async () => {
const command = this._currentFilteredCommands.find(
c => c === this._currentSelectedCommand,
);
this._currentValidate = async (command) => {
if (!command) {
command = this._currentFilteredCommands.find(
c => c === this._currentSelectedCommand,
);
}
if (command) {
!command.isIntermediateStep &&
(!command.shouldPreValidate || command.shouldPreValidate()) &&
......
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