Skip to content

Commit

Permalink
fix: record keys should order a-z
Browse files Browse the repository at this point in the history
  • Loading branch information
morlay committed Dec 20, 2024
1 parent e31973a commit e120871
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nodepkg/jsoneditor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@innoai-tech/jsoneditor",
"version": "0.3.7",
"version": "0.3.8",
"monobundle": {
"build": {
"clean": true
Expand Down
10 changes: 9 additions & 1 deletion nodepkg/jsoneditor/src/inputs/RecordInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ export const RecordInput = component$<{
/>
}
>
{[...props.typedef.entries(obj, props.ctx)].map(
{[...props.typedef.entries((() => {
const o: any = {};

for (const key of Object.keys(obj).toSorted()) {
o[key] = (obj as any)?.[key];
}

return o;
})(), props.ctx)].map(
([propName, propValue, propSchema]) => {
if (!Object.hasOwn(obj, propName)) {
return null;
Expand Down
4 changes: 1 addition & 3 deletions nodepkg/jsoneditor/src/inputs/ValueInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ export const ValueInputActions = styled("div")({
roundedRight: "sm",
display: "flex",
px: 2,
py: 1,
ml: -4
});

Expand Down Expand Up @@ -579,8 +578,7 @@ export const ValueContainer = styled("div")({
},

"& textarea,input": {
border: "1px solid",
borderColor: "rgba(0,0,0,0)",
border: "none",
flex: 1,
rounded: "xs",
containerStyle: "sys.surface-container-lowest",
Expand Down

0 comments on commit e120871

Please sign in to comment.