solidjs-community / solid-aria

A library of high-quality primitives that help you build accessible user interfaces with SolidJS.
Other
289 stars 16 forks source link

`createButton` isn't passing user props to the element #69

Open thetarnav opened 2 years ago

thetarnav commented 2 years ago

User props such as class or children aren't being passed down to returned buttonProps. The button doesn't seem clickable with Enter too..

export const Button: ParentComponent<
  JSX.IntrinsicElements['button'] & AriaButtonProps
> = props => {
  let ref!: HTMLButtonElement
  const { buttonProps } = createButton(props, () => ref)

  return <button {...buttonProps} ref={ref} />
};

// class and children aren't being applied
<Button class="btn">Hello</Button>

repro: https://stackblitz.com/edit/createbutton-props-issue?file=index.tsx