mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(radio-button): forward focus
, blur
events
This commit is contained in:
parent
c6c80d35a9
commit
db5aaee501
3 changed files with 9 additions and 2 deletions
|
@ -71,6 +71,8 @@
|
||||||
required={$groupRequired ?? required}
|
required={$groupRequired ?? required}
|
||||||
{value}
|
{value}
|
||||||
class:bx--radio-button={true}
|
class:bx--radio-button={true}
|
||||||
|
on:focus
|
||||||
|
on:blur
|
||||||
on:change
|
on:change
|
||||||
on:change={() => {
|
on:change={() => {
|
||||||
if (update) {
|
if (update) {
|
||||||
|
|
|
@ -26,6 +26,12 @@
|
||||||
{id}
|
{id}
|
||||||
{name}
|
{name}
|
||||||
{ref}
|
{ref}
|
||||||
|
on:focus={() => {
|
||||||
|
console.log("focus");
|
||||||
|
}}
|
||||||
|
on:blur={() => {
|
||||||
|
console.log("blur");
|
||||||
|
}}
|
||||||
on:change={() => {
|
on:change={() => {
|
||||||
console.log("change");
|
console.log("change");
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -91,8 +91,7 @@ describe("RadioButton", () => {
|
||||||
expect(consoleLog).toHaveBeenCalledWith("change");
|
expect(consoleLog).toHaveBeenCalledWith("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO(bug): forward focus/blur events.
|
it("should handle focus and blur events", async () => {
|
||||||
it.skip("should handle focus and blur events", async () => {
|
|
||||||
const consoleLog = vi.spyOn(console, "log");
|
const consoleLog = vi.spyOn(console, "log");
|
||||||
render(RadioButton);
|
render(RadioButton);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue