# Does DMenu work in Modals?

**URL:** https://meta.discourse.org/t/does-dmenu-work-in-modals/393175
**Category:** Development
**Created:** [January 11, 2026, 9:45am UTC](https://meta.discourse.org/t/does-dmenu-work-in-modals/393175 "2026-01-11T09:45:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [January 11, 2026, 9:45am UTC](https://meta.discourse.org/t/does-dmenu-work-in-modals/393175/1 "2026-01-11T09:45:23Z")

</div>

A search TextField when nested inside a DMenu and DropdownMenu, doesn’t seem to work in Modals.

It works fine on a normal page, e.g. profile settings, but when placed on a Modal the TextField doesn’t seem to respond to typing.

Is this because DMenu is using a portal and there is some problem with its relationship with the modal div?

Here’s an example:

> <https://github.com/merefield/discourse-locations/blob/598df9f4d36194da6e88921ecac39307d50e9dc0/assets/javascripts/discourse/components/geo-d-multi-select.gjs#L342>

Simply put, if I place a debugger statement on the search action, I can show that when placed in a Modal, you never arrive at the search function, but on a “normal” page (outside of a Modal), the event will fire correctly and the search is started.

You cant even type, even if I remove the event hooks.

If I place the TextField in this component outside of the DMenu (still accessed on a modal)- typing behaves as normal.

What am I missing, and why does the behaviour change?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [January 14, 2026, 6:48pm UTC](https://meta.discourse.org/t/does-dmenu-work-in-modals/393175/2 "2026-01-14T18:48:57Z")

</div>

> [@merefield](#):
>
> Is this because DMenu is using a portal and there is some problem with its relationship with the modal div?

Yes I think so, the portal is located outside of the modal and our focus management might be getting in the way (modals capture focus)… does adding `@inline={{true}}` to the `DMenu` fix it? that will put the menu directly within the modal.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [January 30, 2026, 12:19pm UTC](https://meta.discourse.org/t/does-dmenu-work-in-modals/393175/3 "2026-01-30T12:19:46Z")

</div>

Sorry for slow response and appreciate your comment - I did try that but not sure it’s supported for DMenu 🤔 ?

I ended up building a nasty override to implement it (and would be delighted to be able to remove that code)
