-
Notifications
You must be signed in to change notification settings - Fork 28
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
Thank you + missing elements in form object #2
Comments
Good call @geonanorch, I'll add that real quick. FWIW, the custom element itself will be responsible for setting its own value. The |
This should be fixed as part of 0.0.16. |
Thank you @calebdwilliams , works for me! |
Are you saying it is still not accessible under |
Sorry if I was unclear, |
Unfortunately yeah. Although it might be possible to overwrite that getter. I might have to play with that this week. |
Just came across the same problem. The custom elements form values will also not be included in the resulting request data of the form (using Executed in Chrome, the value of the "custom" field will be submitted - in Firefox it is missing. Should this be a new issue? |
That's more or less the same issue and, to be honest, I'm not sure there is a great way of doing that outside of using |
Sadly I can only confirm what BurnedToast reported: if I use 'action' instead of handling the submit with Javascript, custom elements are not included in Firefox & Co. |
So it is not planed to support that input-type-hidden workaround in this polyfill? Maybe there could be an configuration to activate this feature on demand!? Sounds like you already have all the source code for this. |
I do. I’m considering re-enabling it. Trying to decide if it should it be on demand or should I just drop those inputs in by default and be done with it. Do you have any preferences? |
I would suggest configurable/on-demand, and enabled by default. |
I think its a main feature of this polyfill. I would welcome it to be enabled by default :) |
Is this feature still on the roadmap? Do you need some support for this one? |
I literally added it back in yesterday in version |
Hi, was just able to test the new version. Works great. The spec allows this and will upload the file as attachment. The good thing is ... i may have a solution for you. You could create a hidden input-field outside the shadow-root with the type="file" so you may need to hide it with the style instead of type="hidden". That field has the property "files" - containing an own FileList. Sadly you can not add the selected files to that list since it is readonly. And also sadly there is no constructor. But there is a workaround. You can create a new FileList containing the selected File using this code:
With that list you can set the files of the hidden File-Input. I would be happy to see this in your polyfill and will support you as good as I can :) |
The demo fails on Firefox. The elements fail to register to the form when using Firefox. |
First a big thank you + a star for publishing this polyfill !
While testing it I realized that although using the
FormData
API works, more traditional form usage such as in the following snippet does not:Like with a regular input element, under Chrome (so polyfill not used) the
form
object includesform.myel
andform[0]
. With Firefox (so with polyfill) those entries are missing.This issue is to request that the polyfill adds those definitions. Possibly a simple change to the polyfill's
initForm()
method is all it takes, or maybe there is a better way ?The text was updated successfully, but these errors were encountered: