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

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

Open
thetarnav opened this issue Aug 31, 2022 · 0 comments · May be fixed by #72
Open

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

thetarnav opened this issue Aug 31, 2022 · 0 comments · May be fixed by #72
Labels
bug Something isn't working

Comments

@thetarnav
Copy link
Member

thetarnav commented Aug 31, 2022

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

@thetarnav thetarnav added the bug Something isn't working label Aug 31, 2022
@thetarnav thetarnav linked a pull request Sep 1, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant