stripe / stripe-apps

Stripe Apps lets you embed custom user experiences directly in the Stripe Dashboard and orchestrate the Stripe API.
https://stripe.com/docs/stripe-apps
MIT License
147 stars 72 forks source link

Click event handler for <Box> component that passes the event #311

Open heatlikeheatwave opened 2 years ago

heatlikeheatwave commented 2 years ago

Is your feature request related to a problem? Please describe. The only components that allow a click event handler are the <Button> and <Link> components. I'm trying to implement functionality similar to the details element where clicking toggles visibility of interactive content within the <Box> because the <Box> component allows more styling.

Describe the solution you'd like Add onPress event handler to the Component, and pass the event so event.stopPropagation() can be added when the user clicks on interactive content within the component. For example, the <Box> component contains a TextField component when toggled 'open' that the user can type into, which would necessitate event.stopProgation() to not close the <Box>.

Describe alternatives you've considered Adding a link/button that toggles the visibility of hidden content with the box element

Additional context N/A

mjohnsonpint-stripe commented 2 years ago

Can you tell us a little more about the use case here? What do you need users to be able to click? Wondering if we need a UI component we don't have right now. If you have mockups those would be super appreciated - you are welcome to email them to me if you like.

heatlikeheatwave commented 2 years ago

hey @mjohnsonpint-stripe, thanks for getting back to me! I'll follow up in an email with mock ups :)

sandhyaj-stripe commented 2 years ago

Hi @heathergh Let us know if you have those mocks or more information. Thanks! Sandhya