@codeleap/web 3.18.0 → 3.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -113,9 +113,9 @@ export const Checkbox = (props: CheckboxProps) => {
|
|
|
113
113
|
|
|
114
114
|
const _checkboxOnLeft = checkboxOnLeft ?? variantStyles.__props?.checkboxOnLeft
|
|
115
115
|
|
|
116
|
-
const handleChange = () => {
|
|
116
|
+
const handleChange = (e) => {
|
|
117
117
|
if (disabled) return
|
|
118
|
-
if (onValueChange) onValueChange?.(!value)
|
|
118
|
+
if (onValueChange && (e?.type === 'click' || e?.keyCode === 13 || e?.key === 'Enter')) onValueChange?.(!value)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
return <InputBase
|
|
@@ -142,6 +142,8 @@ export const Checkbox = (props: CheckboxProps) => {
|
|
|
142
142
|
animate={boxAnimation}
|
|
143
143
|
transition={variantStyles['box:transition']}
|
|
144
144
|
onClick={handleChange}
|
|
145
|
+
onKeyDown={handleChange}
|
|
146
|
+
tabIndex={0}
|
|
145
147
|
>
|
|
146
148
|
<motion.div
|
|
147
149
|
css={[
|
|
@@ -151,6 +153,7 @@ export const Checkbox = (props: CheckboxProps) => {
|
|
|
151
153
|
initial={false}
|
|
152
154
|
animate={checkmarkWrapperAnimation}
|
|
153
155
|
transition={variantStyles['checkmarkWrapper:transition']}
|
|
156
|
+
|
|
154
157
|
>
|
|
155
158
|
<Icon
|
|
156
159
|
debugName={debugName}
|
|
@@ -106,7 +106,7 @@ export const TouchableCP = <T extends NativeHTMLElement = 'button'>(
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const _onPress = () => {
|
|
109
|
-
if (
|
|
109
|
+
if (event && (event?.type !== 'click' && event?.keyCode !== 13 && event?.key !== 'Enter')) return null
|
|
110
110
|
|
|
111
111
|
logger.log(
|
|
112
112
|
`<${debugComponent || 'Touchable'}/> pressed`,
|