Make Save the exercise dialog's default button
All three menu buttons were implicit submit buttons, so pressing Enter (or the iOS keyboard's "Go") triggered implicit form submission against the first one — the hidden Delete button — which closed the dialog and silently discarded the typed exercise. Delete and Cancel are now type="button", leaving Save as the form's default button.
This commit is contained in:
+5
-2
@@ -277,8 +277,11 @@
|
|||||||
<textarea id="exercise-note" rows="5" placeholder="Reminder for how to train it, e.g. lure with a treat, mark the moment the butt touches the ground, reward"></textarea>
|
<textarea id="exercise-note" rows="5" placeholder="Reminder for how to train it, e.g. lure with a treat, mark the moment the butt touches the ground, reward"></textarea>
|
||||||
</label>
|
</label>
|
||||||
<menu>
|
<menu>
|
||||||
<button value="delete" id="exercise-delete" class="danger" hidden>Delete</button>
|
<!-- type="button" keeps Save the form's default button, so Enter /
|
||||||
<button value="cancel" class="ghost">Cancel</button>
|
the iOS keyboard's "Go" saves instead of silently hitting the
|
||||||
|
(hidden) Delete button via implicit form submission. -->
|
||||||
|
<button type="button" value="delete" id="exercise-delete" class="danger" hidden>Delete</button>
|
||||||
|
<button type="button" value="cancel" class="ghost">Cancel</button>
|
||||||
<button value="save" id="exercise-save">Save</button>
|
<button value="save" id="exercise-save">Save</button>
|
||||||
</menu>
|
</menu>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user