Submit weight after entering value
This commit is contained in:
parent
28250f1862
commit
cb5aa72552
|
@ -39,7 +39,7 @@ export default function EditWeight() {
|
||||||
}, [])
|
}, [])
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const submit = async () => {
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
|
|
||||||
const newWeight: Partial<Weight> = {
|
const newWeight: Partial<Weight> = {
|
||||||
|
@ -93,11 +93,11 @@ export default function EditWeight() {
|
||||||
|
|
||||||
<View style={{ padding: PADDING, flex: 1 }}>
|
<View style={{ padding: PADDING, flex: 1 }}>
|
||||||
<AppInput
|
<AppInput
|
||||||
label="Value"
|
label="Weight"
|
||||||
value={value}
|
value={value}
|
||||||
onChangeText={setValue}
|
onChangeText={setValue}
|
||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
onSubmitEditing={() => unitRef.current?.focus()}
|
onSubmitEditing={submit}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{settings.showUnit && (
|
{settings.showUnit && (
|
||||||
|
@ -124,7 +124,7 @@ export default function EditWeight() {
|
||||||
mode="outlined"
|
mode="outlined"
|
||||||
icon="content-save"
|
icon="content-save"
|
||||||
style={{ margin: MARGIN }}
|
style={{ margin: MARGIN }}
|
||||||
onPress={handleSubmit}
|
onPress={submit}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user