Comments (2)
I see no harm in implementing this, but we should definitely make this opt-in behind a feature flag. It's in theory diverging from browser behavior and there's a few gotchas with manipulating query params, but those are definitely not an issue on most sites, so let's do it :)
I've never heard of the formdata
event before. Is it really as easy as doing this on all your forms? Would this already work with the forms plugin? If yes, there's probably not much to do here, as that's nice and portable.
form.addEventListener('formdata', ({ formData }) => {
for (let [name, value] of Array.from(formData.entries())) {
if (!value) formData.delete(name)
}
})
from forms-plugin.
Ah right! I overlooked the formdata
event in the example. I think I'd still prefer to not use it, as in POST requests, stripping empty parameters wouldn't bring any advantages. I'll get to it
from forms-plugin.
Related Issues (14)
- Submitting to same URL results in error HOT 1
- plugin may not take note of any custom transition attribute? HOT 1
- Error "_Link.Link is not a constructor" when submit form HOT 7
- Doesn't submit textareas
- Contact form 7 (WP) submitting twice HOT 4
- Improve detection of new-tab submissions HOT 1
- Improve detection of form submission into new tab HOT 5
- Feature: support file uploads HOT 5
- Feature: support overriding form behavior from submitter element
- Override focus element for inline forms
- Bug: Consecutive submissions trigger full page reload
- [Bug]: Forms sometimes accidentally open in new tab
- [Feature Request]: Allow to customize the cache behavior in form visits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forms-plugin.