Skip to content

fix(BBButton): render type="button" by default and add type prop - #93

Merged
Arthurk12 merged 2 commits into
bigbluebutton:developfrom
Arthurk12:issue/82
Oct 1, 2026
Merged

Arthurk12 merged 2 commits into
bigbluebutton:developfrom
Arthurk12:issue/82

Conversation

@Arthurk12

Copy link
Copy Markdown
Member

What does this PR do?

  • Sets type="button" on the underlying <button> in every BBButton layout branch (circle/squared, stacked and default), so a BBButton inside a <form> no longer submits it on click.
  • Adds a type?: 'button' | 'submit' | 'reset' prop that defaults to 'button', so a consumer who actually wants a submit or reset button can choose one. The allowed values are in constants.ts (TYPES, TYPE_VALUES, DEFAULT_TYPE), following the other Button enums.
  • Documents the new prop in type.ts (JSDoc), the Storybook argTypes, and the component README (a new "Submit Button" example and a row in the Props table).

Closes Issue(s)

Closes #82

BBButton renders its underlying <button> without a type attribute, and
per the HTML spec such a button defaults to type="submit". Any BBButton
placed inside a <form> therefore submits it on click, on top of running
its own onClick handler. With no onSubmit handler this is a GET to the
current URL, i.e. a full page navigation; inside the BBB client that
hits the beforeunload handler and can drop the user out of the meeting.

Set type="button" on the <button> in every layout branch (circle/squared,
stacked and default), matching what other component libraries (MUI,
Chakra, Radix) do: a button inside a form must not submit it unless the
consumer explicitly asks for that.

Closes bigbluebutton#82
BBButton always renders type="button", so a consumer that genuinely
wants a submit or reset button has no way to get one: ButtonProps does
not accept a type prop, so passing it is rejected by TypeScript and
would not reach the DOM node anyway.

Expose type?: 'button' | 'submit' | 'reset', defaulting to 'button' so
the safe behavior stays the default and submitting a form remains an
explicit opt-in. The allowed values live in constants.ts (TYPES,
TYPE_VALUES, DEFAULT_TYPE) like the other Button enums, and are
documented in the Storybook argTypes and the component README.
@Arthurk12
Arthurk12 merged commit 2d899cf into bigbluebutton:develop Oct 1, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant