Fix object-form breaking on repeat pjax visits, and stray autofill in game rename field

object_form.js declared top-level const bindings, which pjax replays verbatim on every visit — the second visit threw "already declared" and silently broke "Ajouter un champ"/"Créer l'objet". Wrapped it in an IIFE. Also renamed the generic name="name" rename-game field to name="game_name" with autocomplete off, since browsers were autofilling it with unrelated previously-typed values.
This commit is contained in:
william
2026-08-24 09:21:19 +02:00
parent 4b05301e2e
commit 2bb0c253f9
3 changed files with 36 additions and 29 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
<form method="post" action="{{ url_for('game_rename', slug=game.slug) }}" class="fieldRow" style="align-items:flex-end;">
<div>
<label for="rename">Renommer le jeu</label>
<input type="text" id="rename" name="name" value="{{ game.name }}" required>
<input type="text" id="rename" name="game_name" value="{{ game.name }}" required autocomplete="off">
</div>
<button type="submit">Renommer</button>
</form>