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

<form> #120

Closed
oskude opened this issue Sep 27, 2017 · 3 comments
Closed

<form> #120

oskude opened this issue Sep 27, 2017 · 3 comments

Comments

@oskude
Copy link

oskude commented Sep 27, 2017

i tried the <howto-checkbox> in a <form> like this:

diff --git a/elements/howto-checkbox/demo.html b/elements/howto-checkbox/demo.html
index d4b8c4e..e2a065c 100644
--- a/elements/howto-checkbox/demo.html
+++ b/elements/howto-checkbox/demo.html
@@ -25,5 +25,16 @@ limitations under the License.
   }
 </style>
 
+<form id="daform">
 <howto-checkbox aria-labelledby="join-label"></howto-checkbox>
 <span id="join-label">Join Newsletter</span>
+<input type="submit"/>
+</form>
+
+<script>
+var form = document.querySelector("#daform");
+form.addEventListener("submit", (event)=>{
+  event.preventDefault();
+  console.dir(form);
+});
+</script>

after clicking submit, dev console only shows reference to the vanilla submit button:
image

am i doing it wrong?
or why does <form> not see <howto-checkbox>?

ps. this was tested on chromium 61.0.3163.100 with chrome://flags/#enable-experimental-web-platform-features enabled

@robdodson
Copy link
Contributor

nope you're not doing anything wrong. This is just a limitation of using any element that is not one of the built-ins, in a form. You can see a discussion of the topic here: WICG/webcomponents#187

It sounds like standards folks are planning to discuss this at the upcoming TPAC meeting (WICG/webcomponents#641) so I'm hoping to see some progress there. I think we can update the howto-* docs to mention this.

@oskude
Copy link
Author

oskude commented Sep 27, 2017

thank you very much for the links!

I think we can update the howto-* docs to mention this.

that would be sweet.

@robdodson
Copy link
Contributor

@oskude FYI #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants