-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Button focus()
enhancements
#1830
Comments
Note that the <script>
import { Button } from "carbon-components-svelte";
let ref;
$: ref?.focus();
</script>
<Button bind:ref>Primary button</Button> However, I do think that forwarding |
metonym
added a commit
that referenced
this issue
Oct 23, 2023
metonym
added a commit
that referenced
this issue
Oct 23, 2023
metonym
pushed a commit
that referenced
this issue
Jan 10, 2024
Fixed in v0.82.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently,
Button.svelte
does not forward focus events. Addingon:focus
to the element would solve this.Also, to programmatically assign focus, access to the HTML element is required, but currently the Button component does not allow access. Perhaps this would work:
Which would allow
buttonInstance.el.focus()
in parent components.I'm happy to generate a PR if these approaches are acceptable.
The text was updated successfully, but these errors were encountered: