Open keithamus opened 5 months ago
This seems like a good idea.
cc @whatwg/forms
Aside from compat concerns (for which I have no data), this sounds like a good idea to me.
Would <button type="">
still be considered type=submit
? Assuming yes, here is a usecounter: https://chromium-review.googlesource.com/c/chromium/src/+/5698215
I should probably know this but does the spec distinguish the attribute not being present vs it being an empty string? Both resolve to missing value
for enumerated attributes, right? Either way type=""
resolving to type="submit"
seems fine to me.
Yes it does distinguish between them. An attribute whose value is the empty string is present. But we can make certain invalid values map to the Submit Button state as needed for compatibility, including the empty string.
Ok, I'll add separate usecounters for invalid values and empty strings
What problem are you trying to solve?
A
<button type=invalid>
today falls back to the submit behaviour. It would be useful to explore the possibility of making this fall back totype=button
, which would allow future proposals to extend thetype
feature without ramifications.What solutions exist today?
N/A
How would you solve it?
See how many
type=invalid
variants exist in the wild, assessing the compat risk.Anything else?
This was discussed in the WHATNOT meeting