https://src.bluestatic.org
/
ustaxviewer.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c06fb14
)
Sort a Form's lines using localeCompare with numeric=true.
author
Robert Sesek <rsesek@bluestatic.org>
Sun, 15 Mar 2020 16:36:20 +0000
(12:36 -0400)
committer
Robert Sesek <rsesek@bluestatic.org>
Sun, 15 Mar 2020 16:36:20 +0000
(12:36 -0400)
src/FormView.tsx
patch
|
blob
|
history
diff --git
a/src/FormView.tsx
b/src/FormView.tsx
index 9e81ccdff1d00a338a0902b5f7518f1588a7ff49..f559fd91795d5957665912436c91b67890880620 100644
(file)
--- a/
src/FormView.tsx
+++ b/
src/FormView.tsx
@@
-15,7
+15,11
@@
interface FormProps {
}
export default function FormView(props: FormProps) {
- const lines = createMemo(() => Object.values(props.form.lines));
+ const lines = createMemo(() => {
+ const keys = Object.keys(props.form.lines);
+ keys.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
+ return keys.map(k => props.form.lines[k]);
+ });
return (
<>