Implement a dropdownParent feature#1342
Conversation
|
@zoglo I've merged in the most recent |
They are raw, I know. Afair, it needed more work on the positioning, the CSS + keyboard navigation. But thanks for checking out @Xon |
Should look less raw now :') |
|
I'm not sure why the merge reports CI action is failing, but I'll aim to test this PR at the end of this week or early next week |
|
I managed to get Choices.js working perfectly inside a table (or any container) with overflow-x: auto without the dropdown being cut off. Use anchor to set the dropdown position: For now, make sure it has this config: If you need multiple instances: Maybe it works without the position: 'bottom' limitation (not tested): |
|
|
|
@zoglo Can you rebase on the latest |
b920d8d to
095ecb3
Compare
# Conflicts: # src/scripts/choices.ts
* Also add ToDos
… is mandatory with some minor code golfing to trim bundle size
|
@Xon should be done now, something went wrong when rebasing the first time |
|
@zoglo I've done a first pass review and it looks ok. But can you write some e2e tests (ie using playwright) to explore the use of this feature and confirm it is working as expected? |
|
I plan to get a v11.2.2 bugfix release out, and then I'll look to include this for a v11.3.0 release |
|
eagerly awaiting this feature :) |
Description
The implementation would allow specifying a
dropdownParentand if provided, all dropdowns would be appended to it. Additionally, each dropdown is still positioned absolute to the parent (I scratched the idea ofposition: fixedin favor of following the KISS principle and positioning calculation).This would implement and fix the following:
This isn't a feature I need right now (not in the next release and I don't really want to delay that one 🙈), but I experimented with implementing it. It still requires significant selector adjustments for the CSS to work correctly (currently, dropdown styles aren’t fully applied).
Maybe someone else might want to build on this functionality in the future. This PR could serve as a head start and provide some documentation for that purpose.
Screenshots (if appropriate)
Types of changes
Checklist