seas-computing / mark-one

A UI component library for building React Apps (in development)
https://seas-computing.github.io/mark-one/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Button does not allow "form" prop #132

Closed rmainwork closed 1 year ago

rmainwork commented 2 years ago

Description

The Button components currently do not allow the form prop. This is used to allow a button to be placed outside a form, but still be associated with the form.

To Reproduce

<Button
onClick={() => {}}
variant={VARIANT.BASE}
form="myform"
  >
  Click Me
</Button>

Expected Behavior

The JSX expression should compile

Actual Behavior

The error

Type '{ children: string; onClick: () => void; variant: VARIANT.BASE; form: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps & { children?: ReactNode; }'.
  Property 'form' does not exist on type 'IntrinsicAttributes & ButtonProps & { children?: ReactNode; }'

was thrown because ButtonProps does not fully implement all the props permitted by a regular browser button