From 7832f8161ae58dbc9db623d6470b3b5eb7628738 Mon Sep 17 00:00:00 2001 From: abhinandan-verma Date: Thu, 25 Jul 2024 01:04:21 +0530 Subject: [PATCH] fix(checkbox): double click need in chrome --- .changeset/sweet-crabs-buy.md | 5 +++++ packages/core/theme/src/components/checkbox.ts | 2 +- packages/core/theme/src/components/radio.ts | 2 +- packages/core/theme/src/components/toggle.ts | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/sweet-crabs-buy.md diff --git a/.changeset/sweet-crabs-buy.md b/.changeset/sweet-crabs-buy.md new file mode 100644 index 0000000000..117aac5522 --- /dev/null +++ b/.changeset/sweet-crabs-buy.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/theme": patch +--- + +fixed the double click need in chrome for checkbox, switch and radiobuttons (#3528) diff --git a/packages/core/theme/src/components/checkbox.ts b/packages/core/theme/src/components/checkbox.ts index ef1d80b915..7ebf311c7d 100644 --- a/packages/core/theme/src/components/checkbox.ts +++ b/packages/core/theme/src/components/checkbox.ts @@ -21,7 +21,7 @@ import {groupDataFocusVisibleClasses} from "../utils"; */ const checkbox = tv({ slots: { - base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2", + base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none", wrapper: [ "relative", "inline-flex", diff --git a/packages/core/theme/src/components/radio.ts b/packages/core/theme/src/components/radio.ts index 3ac379b212..30f0feeacb 100644 --- a/packages/core/theme/src/components/radio.ts +++ b/packages/core/theme/src/components/radio.ts @@ -27,7 +27,7 @@ import {groupDataFocusVisibleClasses} from "../utils"; */ const radio = tv({ slots: { - base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2", + base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none", wrapper: [ "relative", "inline-flex", diff --git a/packages/core/theme/src/components/toggle.ts b/packages/core/theme/src/components/toggle.ts index 1afa716cc1..8b70dcf2be 100644 --- a/packages/core/theme/src/components/toggle.ts +++ b/packages/core/theme/src/components/toggle.ts @@ -30,7 +30,7 @@ import {groupDataFocusVisibleClasses} from "../utils"; */ const toggle = tv({ slots: { - base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer touch-none tap-highlight-transparent", + base: "group relative max-w-fit inline-flex items-center justify-start cursor-pointer touch-none tap-highlight-transparent select-none", wrapper: [ "px-1", "relative",