Repository navigation
Lists: insert an item at a specific position (and/or a config option for where "Add an item" adds) #434
elijahcantu
started this conversation in
Ideas
Replies: 1 comment
|
Sure, I could add an option. I'm still working on the TanStack Start migration right now. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
First off, thanks for Pages CMS — I just set it up for my research lab's Jekyll site so non-technical lab members can edit content, and it's been great.
The problem
For list fields (e.g. an object list of news items or publications in a YAML data file), "Add an item" always appends to the end of the array, and items render in stored order. For chronological content this creates friction:
Drag-and-drop reordering works well for occasional fixes, but it's not great as the required step for every insertion that isn't "at the end."
Idea
A list config option for where "Add an item" inserts, e.g.:
With
add: startthe chronological-content case just works: store newest-first, display in stored order, and new items appear at the top where they belong.Nice to have alongside it: inserting between items, Jupyter-notebook style — a small "+" affordance between rows (or on hover), or "Insert above / Insert below / Duplicate" actions on each item's row.
useFieldArrayalready exposesinsert()— the UI currently only usesappend,remove, andmove.Happy to provide more detail on our setup if useful. Thanks for considering it!
All reactions