Skip to content

How can I recreate a button that triggered a normal form submit event when clicked? #113

Answered by UpperCod
huvber asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @huvber . An excellent topic to discuss. With Atomico, you can achieve it, and to make it easier, we have certain utilities like useRender. This hook allows you to render a fragment in the lightDOM separately from what you render in the ShadowDOM. This is useful for achieving the effect you mentioned. I'm attaching documentation on this and an example of your goal.

  1. Documentation : https://atomico.gitbook.io/doc/guides/atomico-design-patterns/webcomponents-with-hybrid-rendering#what-are-the-benefits-of-using-userender
  2. Example: https://stackblitz.com/edit/example-form?file=src%2Fmy-button.tsx,index.html,src%2Fmy-input.tsx

I hope it is useful to you and I will be attentive to what you n…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by huvber
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants