File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/clay-color-picker/src Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export function Editor({
148
148
onHueChange,
149
149
} : Props ) {
150
150
const { b, g, r} = color . toRgb ( ) ;
151
- const { s, v} = color . toHsv ( ) ;
151
+ const { h , s, v} = color . toHsv ( ) ;
152
152
153
153
const rgbArr : Array < [ number , string ] > = [
154
154
[ r , 'r' ] ,
@@ -170,7 +170,7 @@ export function Editor({
170
170
tinycolor ( { h : hue , s, v} ) . setAlpha ( color . getAlpha ( ) )
171
171
) ;
172
172
} }
173
- value = { hue }
173
+ value = { Math . round ( h ) }
174
174
/>
175
175
< div className = "clay-color-map-group" >
176
176
< GradientSelector
Original file line number Diff line number Diff line change @@ -416,9 +416,12 @@ describe('Interactions', () => {
416
416
) as Array < HTMLElement > ;
417
417
418
418
fireEvent . change ( hueSlider as HTMLElement , { target : { value : 1 } } ) ;
419
- fireEvent . change ( hueSlider as HTMLElement , { target : { value : 0 } } ) ;
420
419
421
- expect ( handleColorsChange ) . toBeCalledTimes ( 2 ) ;
420
+ fireEvent . change ( hueSlider as HTMLElement , { target : { value : 2 } } ) ;
421
+
422
+ fireEvent . change ( hueSlider as HTMLElement , { target : { value : 1 } } ) ;
423
+
424
+ expect ( handleColorsChange ) . toBeCalledTimes ( 3 ) ;
422
425
} ) ;
423
426
} ) ;
424
427
You can’t perform that action at this time.
0 commit comments