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

Button: no way to make a submit button? #3

Open
adam-lynch opened this issue Aug 14, 2024 · 4 comments
Open

Button: no way to make a submit button? #3

adam-lynch opened this issue Aug 14, 2024 · 4 comments

Comments

@adam-lynch
Copy link

Am I right in saying that there is no way to add type="submit" to the button element produced by the Button component?

@adam-lynch
Copy link
Author

adam-lynch commented Aug 14, 2024

Maybe the current type parameter should be named kind / category / style and the component should pass on any arbitrary props like I suggested for #4?

@Zwillinge
Copy link

Hello,

I'm not sure that type="submit" makes much sense without the related form, while in SVAR Core we provide just a set of simple controls. At the same time, the team is currently working on a fully functional Editor component, which will include the possibility to collect and process input values. Probably it will be released this autumn.

@adam-lynch
Copy link
Author

adam-lynch commented Aug 17, 2024

Hi, thanks for the response...

I'm not sure that type="submit" makes much sense without the related form, while in SVAR Core we provide just a set of simple controls.

In my case, I put it inside a (regular) <form>, which is a reasonable use case in my opinion.

I think of it like this: I need a button. There's a SVAR button component. I should be able to use it like a regular <button>. It can do extra stuff, cool, but I should at least be able to use it like a <button>.

So I should be able to somehow set all of the attributes a regular <button> supports. I shouldn't have to use the SVAR button in some cases and hand-write my own separate button component for other cases (of course that's ok if it's really weird/unusual use case that a regular <button> wouldn't support).

For all of your components (not just the button component), this would be good:

  • They should accept and pass down arbitrary props.
  • None of the SVAR props' names should clash with the underlying HTML element's attributes (unless they do the same thing). (This is why I suggested renaming the current type prop)

This would make the components easier to work with, and it would save people having to create issues because they need support for a specific attribute.

@Zwillinge
Copy link

Thank you for your help and suggestions

They should accept and pass down arbitrary props

Well, on second thought, it looks reasonable as it doesn't create any limitations in usage. We will revise the controls and consider to implement the above-mentioned.

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