Choices icon indicating copy to clipboard operation
Choices copied to clipboard

What's the equivalent to Select2's DropdownParent: 'body in Choices?

Open rgaufman opened this issue 4 months ago • 3 comments

I have some elements that are positioned to have a fixed height, etc and trying to use Choices JS the dropdown gets cut off. The solution for that in Select2 was to use DropdownParent: 'body" to make sure such dropdowns are added to body and float nicely above everything else.

How would I achieve something like this with Choices?

rgaufman avatar Aug 23 '25 00:08 rgaufman

Hey @rgaufman afaik there currently isn't a way to append the dropdown to the body, you can read more about it in the related issues:

  • #930
  • #1131
  • #1288
  • #1309

zoglo avatar Aug 23 '25 11:08 zoglo

Ah, that's frustration, I ended up switching to tom-select which has a dropdownParent option which does what I need. Choices JS is great otherwise, but it's too much work to make it work without being able to specify a parent.

rgaufman avatar Aug 23 '25 12:08 rgaufman

@rgaufman See #1342 for a draft PR implementing this feature. The PR will still require significant adjustments to the CSS because of specificity issues but it's nothing I need right now (as in the next release, maybe I continue this later on 😊)

zoglo avatar Aug 23 '25 16:08 zoglo