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

add type to button elements #10234

Open
jatinmarwah opened this issue Dec 6, 2024 · 0 comments
Open

add type to button elements #10234

jatinmarwah opened this issue Dec 6, 2024 · 0 comments

Comments

@jatinmarwah
Copy link

Q&A (please complete the following information)

  • OS: [e.g. macOS] Any
  • Browser: [e.g. chrome, safari] Chrome, Safari
  • Version: [e.g. 22] 5.18.2
  • Method of installation: [e.g. npm, dist assets] npm
  • Swagger-UI version: [e.g. 3.10.0] 5.18.2
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

# [Online Swagger Pet Store](https://petstore.swagger.io)

Swagger-UI configuration options:

SwaggerUI({
  // nothing extra
})
?yourQueryStringConfig

Describe the bug you're encountering

Our Swagger UI React is wrapped under React Hook Form and whenever the Swagger expand spec is clicked (The down arrow) the whole form submits, this is because of missing type attribute in native <button> element. Request you to add type on your buttons like <button type="button" > to avoid any default submission.

This is a sample element currently -

To reproduce...

Steps to reproduce the behavior:

  1. Go to Pet Store
  2. Click on Inspect Element of "Down Arrow" of any endpoint like '/pet/{petId}/uploadImg
  3. Scroll down to the HTML Button element and see there is no Type attribute
  4. See missing attribute

Expected behavior

the tag should be present with attribute so that any Swagger UI under form submission works properly

Screenshots

Additional context or thoughts

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

1 participant