feat(app): submit question card answer on Enter key press
This commit is contained in:
@@ -119,6 +119,7 @@ export function QuestionFormCard({ permission, onRespond, isResponding }: Questi
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
|
if (!allAnswered || isResponding) return;
|
||||||
setRespondingAction("submit");
|
setRespondingAction("submit");
|
||||||
const answers: Record<string, string> = {};
|
const answers: Record<string, string> = {};
|
||||||
for (let i = 0; i < questions!.length; i++) {
|
for (let i = 0; i < questions!.length; i++) {
|
||||||
@@ -228,7 +229,9 @@ export function QuestionFormCard({ permission, onRespond, isResponding }: Questi
|
|||||||
placeholderTextColor={theme.colors.foregroundMuted}
|
placeholderTextColor={theme.colors.foregroundMuted}
|
||||||
value={otherText}
|
value={otherText}
|
||||||
onChangeText={(text) => setOtherText(qIndex, text)}
|
onChangeText={(text) => setOtherText(qIndex, text)}
|
||||||
|
onSubmitEditing={handleSubmit}
|
||||||
editable={!isResponding}
|
editable={!isResponding}
|
||||||
|
blurOnSubmit={false}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user