[FIX] mail: edit follower subtype should close dropdown
Before this commit, when editing subtype of a follower (click on pencil icon to edit), the subtype dialog was displayed while keeping the follower list dropdown open. This happens because `FollowerList` makes use of `Dropdown` and `DropdownItem`, and by default they manage closing of dropdown item when clicking away of when clicking on the dropdown item. However, when there are specific clickable elements on the `DropdownItem`, the clicks do not auto-close the dropdown menu. This commit fixes the issue by specifically close the dropdown menu when clicking on edit button of a follower in follower list. Task-3435443 closes odoo/odoo#129413 X-original-commit: a33f60356ba7c12bd854eb0efe5c653ff1559495 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com> Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -69,6 +69,7 @@ export class FollowerList extends Component {
|
||||
follower,
|
||||
onFollowerChanged: () => this.props.onFollowerChanged?.(),
|
||||
});
|
||||
document.body.click(); // hack to close dropdown
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,6 +121,7 @@ QUnit.test("click on edit follower", async (assert) => {
|
||||
assert.containsOnce($, "button[title='Edit subscription']");
|
||||
|
||||
await click("button[title='Edit subscription']");
|
||||
assert.containsNone($, ".o-mail-Follower");
|
||||
assert.verifySteps(["fetch_subtypes"]);
|
||||
assert.containsOnce($, ".o-mail-FollowerSubtypeDialog");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user