fix(web-vue): Button rendered a <div> — clicks could not submit forms - #60
Merged
Conversation
…ould not submit forms or receive disabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Headless-Chrome e2e against the local api found this: ui/button.vue rendered reka-ui
Primitivewith noas, so every<Button>was a<div type="submit">— a div cannot submit a form, cannot bedisabled, and swallows the click. Login by button-click could never work in web-vue; Enter-to-submit was also dead because HTML implicit submission needs a real submit button.Fix: Primitive defaults to
as="button"+type="button";asChildstill swaps in the slot child; callertype="submit"attrs override.Verified: e2e login through the real form (requestSubmit -> 200 -> redirect -> /account/profile -> avatar upload -> PATCH 200 -> object in LocalStack S3, public GET 200).
Related localhost gotcha found while testing (not fixed here): with no registrable domain, Chrome treats
localhost:3005->localhost:4100as cross-SITE, so the loginSet-Cookie(SameSite=Lax) is dropped by the browser even though the server sends it correctly. The auth-cookies "lax for multiple ports" comment is only true for real domains. Local dev workaround: viteserver.proxy/v1-> :4100 andVITE_API_URL=/v1(same-origin). Happy to add that as a follow-up.