-
-
Notifications
You must be signed in to change notification settings - Fork 150
bug: Form-associated Stencil component with type="submit" does not submit form in React #776
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.43.3
Current Behavior
When using a Stencil component with formAssociated: true and setting the type prop to "submit", clicking the component does not submit the form when used inside a React application.
The component behaves correctly when used in native HTML (without any framework) — clicking the button submits the form as expected.
So far this issue appears only when the component is used in React. I have not yet tested it with other frameworks.
NOTE: In the production, I use react-output-target version 0.5.3 but I also tested on the latest version, and still the same issue.
Expected Behavior
When a Stencil component is configured with formAssociated: true and the type prop is set to "submit", clicking the component should trigger the native form submission, regardless of the framework used (including React).
System Info
System: node 22.22.0
Platform: windows (10.0.26200)
CPU Model: 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz (12 cpus)
Compiler: D:\Work\Projects\node_modules\.pnpm\@stencil+core@4.43.2\node_modules\@stencil\core\compiler\stencil.js
Build: 1772184285
Stencil: 4.43.2
TypeScript: 5.8.3
Rollup: 4.44.0
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0Steps to Reproduce
- Install dependencies - pnpm -r i
- Build the project - pnpm -r build
- Navigate to the example React app
- cd packages/my-app
- Run the development server - pnpm run dev
- Open the provided production URL and test the form.
- Click the Stencil component with type="submit".
Code Reproduction URL
https://github.com/a7medm7med/stencil-button-submit-issue
Additional Information
No response