mirror of
https://github.com/discourse/discourse.git
synced 2025-06-08 00:27:32 +08:00
FIX: ensures close arg from d-menu/:content works (#23773)
This commit is contained in:
@ -183,4 +183,15 @@ module("Integration | Component | FloatKit | d-menu", function (hooks) {
|
|||||||
assert.dom(".fk-d-menu").hasAttribute("style", /left: /);
|
assert.dom(".fk-d-menu").hasAttribute("style", /left: /);
|
||||||
assert.ok(find(".fk-d-menu").getAttribute("style").includes("top: "));
|
assert.ok(find(".fk-d-menu").getAttribute("style").includes("top: "));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("content close argument", async function (assert) {
|
||||||
|
await render(
|
||||||
|
hbs`<DMenu @inline={{true}}><:trigger>test</:trigger><:content as |args|><DButton @icon="times" @action={{args.close}} /></:content></DMenu>`
|
||||||
|
);
|
||||||
|
await open();
|
||||||
|
|
||||||
|
await click(".d-icon-times");
|
||||||
|
|
||||||
|
assert.dom(".fk-d-menu").doesNotExist();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ export default class DMenu extends Component {
|
|||||||
|
|
||||||
get componentArgs() {
|
get componentArgs() {
|
||||||
return {
|
return {
|
||||||
close: this.menu.close,
|
close: this.menuInstance.close,
|
||||||
data: this.options.data,
|
data: this.options.data,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user