New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyValue
->reorderable()
doesn't work
#11128
Comments
Duplicate of #9030? Please check your Livewire version |
KeyValue
->reorderable()
doesn't work
@sandersjj, have you found the fix yet? |
No I ended up not using the KeyValue field. |
I think the problem itself is in trying to add the ordering to one-dimensional array. json.org states that:
That not only means that order of name/value pairs is (could be) not preserved, but also that two objects which differ only by order of name/value pairs are (should be) considered the same. On the other hand, php.net states that:
The order is preserved for string keys, but numeric keys could not be ordered inherently. Thus, the KV component itself should either not have "ordering" feature, or change the storage mechanism to "array of objects". For example, instead of storing as: This way, the ordering will be preserved both in frontend and backend. Here is the small demonstration: https://wirebox.app/b/41729 |
Package
filament/filament
Package Version
v3.2.16
Laravel Version
v10.41.0
Livewire Version
No response
PHP Version
PHP8.2.15
Problem description
This should reorder the key/values and save them in the db as such. However when you change the order and reload the page or go back to the edit page. The ordering has not changed
Expected behavior
The Ordering set by the user should be respected
Steps to reproduce
Reproduction repository
https://github.com/sandersjj/filament-issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: