elm-select icon indicating copy to clipboard operation
elm-select copied to clipboard

Allow custom order for item groups

Open RisottoNacho opened this issue 6 months ago • 4 comments

The items groups are ordered alphabetically using the group label by default, with no way of customizing their order on the selector. This is because they are stored as a dictionary, if they were a list, insertion order could be preserved.

Image

RisottoNacho avatar May 28 '25 15:05 RisottoNacho

Hi @RisottoNacho 👋 ,

Thanks for opening an issue.

This is because they are stored as a dictionary, if they were a list, insertion order could be preserved.

Yep, you're 100% right!

I think at the very least it should preserve insertion order, that way you can control it on the calling side.

I'll have a look this weekend for you.

Confidenceman02 avatar May 28 '25 21:05 Confidenceman02

Nice to hear you agree 😄

Thanks for the feedback

RisottoNacho avatar May 29 '25 09:05 RisottoNacho

Many appologies I couldn't get to it on the weekend. It's on the radar I assure you 😄

Hopping this week I have success.

Buenas.

Confidenceman02 avatar Jun 02 '25 04:06 Confidenceman02

Any news on this?

RisottoNacho avatar Nov 12 '25 10:11 RisottoNacho

Hi @RisottoNacho ! So sorry my friend, I totally neglected this. Yes, i'm going to put in a couple hours this weekend to see if my idea works out!

I had this exact issue pop up for me last week so I'm motivated to sort it out.

Confidenceman02 avatar Nov 13 '25 01:11 Confidenceman02

Released in 12.2.3

Confidenceman02 avatar Nov 17 '25 05:11 Confidenceman02

Just take note that this bug still exists https://github.com/Confidenceman02/elm-select/issues/210 that needs to be addressed when using a mixture of grouped and un-grouped menu items.

Other than that the grouped order will respect insertion order.

Thanks again for opening the issue, I'll keep it open in case you want to confirm it works for you or any questions you might have.

👍

Confidenceman02 avatar Nov 17 '25 05:11 Confidenceman02

Seems to be working just fine, thanks for the feedback 💯

RisottoNacho avatar Nov 17 '25 11:11 RisottoNacho