-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add type="button" attribute to all buttons #1077
Comments
Hi there. Could you clarify your request? Which buttons are you talking about, the button components? Could you explain your use case? Do you mean that you would like the option to set the action type to be |
Hello. That's not what I meant. I am using inside a form element like this:
The fact that there is no The same thing is in the Button field. This part is just a builder. Therefore, even if "Submit" or "Button" is selected from the right side, I think there will be no problem if the attribute type value is set to button. |
@bilalmalkoc Ah I understand. The thing is you're not supposed to put the entire editor inside of an HTML form, as it is not a form. I still think it's not a bad idea to set the buttons to type button on these elements, just for clarity, but wrapping the editor in a form doesn't make sense to me. What are you trying to achieve with that? |
Yes, you are right that there is no form. When we need to integrate the builder with some CMSs, we may need to put it in the form element. Like WordPress for example. Unfortunately I don't have an option to put it outside the form element. Because the entire page where I place it is inside a form element :) I still think the correct usage is |
@bilalmalkoc I agree, but to fix this here also means changing the properties panel, so it requires some changes in external libraries + integration. I already created a PR for the changes on this library though. |
But there may be the case where we're dependent on a library not owned by bpmn-io, and then you're just out of luck as we wouldn't be able to change the buttons. So I still think the correct fix is not to have the editor inside the form. To be completely safe, if you're really FORCED to render it inside the form, I would try and intercept the submission events programmatically. Because you never know. |
As I said, since it is a common CMS, it would not be good to control submission events. There could be thousands of plugins using the same form. But I'll see what I can do with this part. Also, I am currently adding If you have a solution for this, I can implement it. Or if a callback like "focused" can be added to the form elements, this would also be useful. So we can manipulate the button elements inside every time there is focus. |
Yeah if you'd like that, it's a feature request and we can separate that out in another ticket. We've already implemented in some other fields so it shouldn't be a tough sell.
I mean you can react to formEditor |
Okay. Do you want me to open a new issue for a new callback request? |
Yes please, if you want to implement it yourself that's also good, just please follow the feature request template and then we can discuss who and when it'll be worked on :) |
(edited by @Skaiir for clarity)
Describe the issue
Buttons in the form editor (and playground) aren't always configured to type "button", which makes them default to "submit" behavior which may submit an externally defined form accidentally.
Describe the solution you'd like
For clarity, and to avoid these kinds of interactions, we should:
The text was updated successfully, but these errors were encountered: