Skip to content

Commit

Permalink
Disable spellcheck for the review input in iOS 16 (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
bill876 authored Nov 21, 2022
1 parent 0dec017 commit 9d0b5d2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/views/ReviewPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ function checkAnswer(e: Event) {
showReport.value = rev.completed();
}
// [Note 1]
// <input type="url"> disables keyboard suggestions on iOS 16 safari, and
// <form novalidate> disables validation for being a url (that gets enabled by type url).
// This is an (only?) acceptable use for this pattern - for teaching purposes,
// where we want to verify that the user can spell words without help.
// This is a hack and it will eventually break.
</script>

<template>
Expand Down Expand Up @@ -266,15 +273,17 @@ function checkAnswer(e: Event) {
>
{{ typeName }}
</div>
<form @submit="checkAnswer">
<form @submit="checkAnswer" novalidate>
<input
v-model="answerInput"
@input="onAnswerInput"
class="kz-input answer-form japanese w-100 p-2"
:class="{ 'kz-danger': wrongAnswer }"
placeholder=""
spellcheck="false"
type="url"
/>
<!-- see [Note 1] -->
</form>
</div>

Expand Down

0 comments on commit 9d0b5d2

Please sign in to comment.