Skip to content

Commit 18355fd

Browse files
fix(@clayui/color-picker): use ClayButton instead of button element
1 parent 361f151 commit 18355fd

File tree

3 files changed

+223
-221
lines changed

3 files changed

+223
-221
lines changed

packages/clay-color-picker/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"react"
2727
],
2828
"dependencies": {
29+
"@clayui/button": "^3.5.0",
2930
"@clayui/drop-down": "^3.8.4",
3031
"@clayui/form": "^3.14.2",
3132
"@clayui/icon": "^3.1.0",

packages/clay-color-picker/src/Splotch.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6+
import ClayButton from '@clayui/button';
67
import classNames from 'classnames';
78
import React from 'react';
89
import tinycolor from 'tinycolor2';
@@ -37,20 +38,20 @@ const ClayColorPickerSplotch = React.forwardRef<HTMLButtonElement, IProps>(
3738
!color.isValid() || tinycolor.readability('#FFF', value) < 1.1;
3839

3940
return (
40-
<button
41+
<ClayButton
4142
{...otherProps}
42-
className={classNames('btn clay-color-btn', className, {
43+
className={classNames('clay-color-btn', className, {
4344
active,
4445
'clay-color-btn-bordered': requireBorder,
4546
})}
47+
displayType={null}
4648
ref={ref}
4749
style={{
4850
background: `${isHex ? '#' : ''}${value}`,
4951
height: size,
5052
width: size,
5153
}}
5254
title={value}
53-
type="button"
5455
/>
5556
);
5657
}

0 commit comments

Comments
 (0)