# Sorting select based on label

**URL:** <https://jsonforms.discourse.group/t/sorting-select-based-on-label/2568>\
**Category:** General\
**Created:** [January 24, 2025, 8:25am UTC](https://jsonforms.discourse.group/t/sorting-select-based-on-label/2568 "2025-01-24T08:25:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin-juul](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/martin-juul/32/1210_2.png) [@martin-juul](https://jsonforms.discourse.group/u/martin-juul)\
**Post date:** [January 24, 2025, 8:25am UTC](https://jsonforms.discourse.group/t/sorting-select-based-on-label/2568/1 "2025-01-24T08:25:53Z")

</div>

Currently enums are sorted based on the input schema. But that makes the select un natural to use, when the translations take over since it is then not sorted A-Z according to the translations but A-Z according to the schema.

Is this something the library will support in the future?

I’m using the react library btw.

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [January 24, 2025, 8:41am UTC](https://jsonforms.discourse.group/t/sorting-select-based-on-label/2568/2 "2025-01-24T08:41:43Z")

</div>

Hi @martin-juul,

At the moment we do not support sorting the enum options out of the box. However that is a straightforward customization with a custom enum renderer.

What you should do is to follow [this guide](https://jsonforms.io/docs/tutorial/custom-renderers#reusing-existing-controls) on how to reuse existing renderers. However instead of wrapping the renderer with some additional UI, you simply reuse it as is, with the exception of sorting the options before invoking it.

The renderer to reuse is the [MaterialEnumControl](https://github.com/eclipsesource/jsonforms/blob/6af8825e004fe6cbdccd4a522041130561ab82b4/packages/material-renderers/src/controls/MaterialEnumControl.tsx).
