question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing `type` to `<Button>`

See original GitHub issue

Hiya! In using the <kbd><Button></kbd> component inside of a form, I attempted to give it the type="submit" attribute, but it was overwritten with type="button":

<form>
  <Button type="submit">Place order for pizza</Button>
  {/* rendered as <button type="button"> */}
</form>

It’d be great to allow type to be set, and then I guess setting button as the defaultProp? Let me know if I can help!

cc @emplums, chatted about this in Slack 😊

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shawnbotcommented, Jan 18, 2019

Thanks for reporting this, @JasonEtco! 🤘

1reaction
colebemiscommented, Jan 17, 2019

Yeah, looks like type="button" was hard-coded in 7.0.0-beta. Should be fixed in 8.2.0-beta 👍 https://github.com/primer/components/blob/8714be7aa7f8c663edc2c13fa5bb78175b44178f/src/Button.js#L25-L27

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass additional data with submit button - Stack Overflow
How can I pass to my controller, or, whatever, additional value, which depends on button? <button type="submit" ?????? >Save</button> What should be here?...
Read more >
<input type="button"> - HTML: HyperText Markup Language
elements of type button are rendered as simple push buttons, ... all three buttons to be disabled until the two second timeout has...
Read more >
Button class: How to send arguments with function
I have a simple Button class in a parent scene that runs a function when tapped. It works perfectly now, as you pass...
Read more >
Forms in HTML documents - W3C
Authors create buttons with the BUTTON element or the INPUT element. Please consult the definitions of these elements for details about specifying different ......
Read more >
How to Pass Arguments to Tkinter Button Command?
Method 1: Pass Arguments to Tkinter Button using the lambda function. Import the Tkinter package and create a root window. Give the root ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found