Skip to content

Conversation

@jefvel
Copy link

@jefvel jefvel commented Sep 3, 2025

What?

The relationship field options uses the collection's defaultSort or sortOptions props to sort search results in the back end. Currently it will also always alphabetically sort the options on the front end. This PR conditionally disables that alphabetical sorting.

Why?

The alphabetical sort can make the options list jump around when searching, and overrides the preferred sorting of search results.

How?

Checks if the sort param is not set to default id, and determines whether or not to sort on the front end.

Before:

clientside-sorted.mp4

After:

Kapture.2025-09-03.at.15.38.26.mp4

Hope this is an acceptable solution, feedback is welcome in case there's a better way :)

Thanks!

…ationship field if a non ID field is used for sorting
@ArturLindstrom
Copy link

Waiting for this! 🙋‍♂️

@github-actions github-actions bot removed the stale label Oct 29, 2025
@github-actions github-actions bot added the stale label Nov 29, 2025
@github-actions github-actions bot removed the stale label Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants