Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use current location as base url for form action #27

Merged
merged 4 commits into from
Sep 23, 2021

Conversation

itsMapleLeaf
Copy link
Collaborator

Attempting to use the action attribute with Form raises an error. The new URL constructor also needs a base URL if just being passed a path, which serves as the "fallback" of whatever's incomplete in the first arg. So new URL('/somepath', window.location.href) should come out to https://localhost:4000/somepath (assuming localhost 4k)

Also includes some generic type fixes and improvements

@itsMapleLeaf itsMapleLeaf added 🐛 bug Something isn't working 📦 feature New feature or request labels Sep 23, 2021
@itsMapleLeaf itsMapleLeaf self-assigned this Sep 23, 2021
src/form.tsx Show resolved Hide resolved
package.json Show resolved Hide resolved
If the end user doesn't have the types installed for the libraries we require, they could potentially end up with any types. Using a wide major version to share the user's local types version if they installed them
@smeijer smeijer changed the title fix: URL error for forms with action + type improvements fix: use current location as base url for form action Sep 23, 2021
@smeijer smeijer merged commit 421fa76 into main Sep 23, 2021
@smeijer smeijer deleted the form-action-url-error branch September 23, 2021 15:35
@smeijer smeijer removed the 📦 feature New feature or request label Sep 23, 2021
@smeijer
Copy link
Owner

smeijer commented Sep 23, 2021

Thanks! Published https://github.com/smeijer/next-runtime/releases/tag/v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants