fix(radio-button): forward focus, blur events

This commit is contained in:
Eric Liu 2025-03-22 08:45:44 -07:00
commit db5aaee501
3 changed files with 9 additions and 2 deletions

View file

@ -71,6 +71,8 @@
required={$groupRequired ?? required}
{value}
class:bx--radio-button={true}
on:focus
on:blur
on:change
on:change={() => {
if (update) {

View file

@ -26,6 +26,12 @@
{id}
{name}
{ref}
on:focus={() => {
console.log("focus");
}}
on:blur={() => {
console.log("blur");
}}
on:change={() => {
console.log("change");
}}

View file

@ -91,8 +91,7 @@ describe("RadioButton", () => {
expect(consoleLog).toHaveBeenCalledWith("change");
});
// TODO(bug): forward focus/blur events.
it.skip("should handle focus and blur events", async () => {
it("should handle focus and blur events", async () => {
const consoleLog = vi.spyOn(console, "log");
render(RadioButton);