diff --git a/assets/js/app.js b/assets/js/app.js index f161731..90fa638 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -36,6 +36,17 @@ let liveSocket = new LiveSocket('/live', Socket, { window.Alpine.clone(from, to) } } + }, + hooks: { + supressEnterSubmission: { + mounted() { + this.el.addEventListener('keypress', (event) => { + if (event.key === 'Enter') { + event.preventDefault() + } + }) + } + } } }) diff --git a/lib/pinchflat_web/components/layouts/partials/upgrade_button_live.ex b/lib/pinchflat_web/components/layouts/partials/upgrade_button_live.ex index 959edae..17e1ac2 100644 --- a/lib/pinchflat_web/components/layouts/partials/upgrade_button_live.ex +++ b/lib/pinchflat_web/components/layouts/partials/upgrade_button_live.ex @@ -3,10 +3,11 @@ defmodule Pinchflat.UpgradeButtonLive do def render(assigns) do ~H""" -
+ <%!-- The setTimeout is so the modal has time to disappear before it's removed --%> <.button class="w-full mt-4" type="button"