mirror of
https://github.com/filamentphp/filament.git
synced 2026-10-13 17:36:15 +08:00
* fix(forms): preserve the order of rich editor mention options Mention options were sent to JavaScript as an object keyed by ID, and `toItemsArray()` reads them back with `Object.entries()`. JavaScript orders integer-like keys ascending numerically, so for models with numeric primary keys the developer's ordering was silently replaced with an ascending-ID sort, for both `items()` and `getSearchResultsUsing()`. Items are now sent as an ordered list of `id` and `label` pairs. The JS already supports that shape, so no JS change is required. This also fixes a related edge case: PHP re-casts numeric-string array keys back to integers, so a provider whose IDs were 0-based and sequential serialised to a JSON array of bare labels, and the inserted mention took its label as its `id`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011LniPBty6yFENqFFcMcNad * fix(forms): preserve zero-valued mention IDs --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Dan Harrin <git@danharrin.com>