mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +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.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() {
|
||||
return {
|
||||
close: this.menu.close,
|
||||
close: this.menuInstance.close,
|
||||
data: this.options.data,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user