Skip to content

Commit

Permalink
fix: assign button type in React Vanilla renderers
Browse files Browse the repository at this point in the history
Assign button type to all buttons rendered in React Vanilla to avoid
accidental submitting of forms.
  • Loading branch information
joefreeman authored Mar 8, 2024
1 parent 30c1b79 commit 24f4e5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vanilla-renderers/src/complex/TableArrayControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class TableArrayControl extends React.Component<
<header>
<label className={labelClass}>{label}</label>
<button
type='button'
className={buttonClass}
onClick={addItem(path, createDefaultValue(schema, rootSchema))}
>
Expand Down Expand Up @@ -214,6 +215,7 @@ class TableArrayControl extends React.Component<
</td>
<td>
<button
type='button'
aria-label={translations.removeAriaLabel}
onClick={() => {
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const ArrayControl = ({
<header>
<label className={labelClass}>{label}</label>
<button
type='button'
className={buttonClassAdd}
onClick={addItem(path, createDefaultValue(schema, rootSchema))}
>
Expand All @@ -118,6 +119,7 @@ export const ArrayControl = ({
/>
<div className={childControlsClass}>
<button
type='button'
className={buttonClassUp}
aria-label={translations.upAriaLabel}
onClick={() => {
Expand All @@ -127,6 +129,7 @@ export const ArrayControl = ({
{translations.up}
</button>
<button
type='button'
className={buttonClassDown}
aria-label={translations.downAriaLabel}
onClick={() => {
Expand All @@ -136,6 +139,7 @@ export const ArrayControl = ({
{translations.down}
</button>
<button
type='button'
className={buttonClassDelete}
aria-label={translations.removeAriaLabel}
onClick={() => {
Expand Down

0 comments on commit 24f4e5f

Please sign in to comment.