Skip to content

Commit 8567fb3

Browse files
committed
Fallback
1 parent 5c2b465 commit 8567fb3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/uui-color-slider/lib/uui-color-slider.story.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ export const Advanced: Story = {
107107

108108
const element = e.target as UUIColorSliderElement;
109109

110-
console.log('Slider changed', element.value);
111-
112110
if (isNaN(element.value)) return;
113111

114112
const newColor: HslaColor = {
@@ -137,8 +135,13 @@ export const Advanced: Story = {
137135
e.stopPropagation();
138136

139137
const input = e.target as HTMLInputElement;
140-
const newValue = parseFloat(input.value);
141-
if (isNaN(newValue)) return;
138+
139+
let newValue = parseFloat(input.value);
140+
141+
if (isNaN(newValue)) {
142+
newValue = 0;
143+
input.value = '0';
144+
}
142145

143146
const newColor: HslaColor = {
144147
h: value.h,

0 commit comments

Comments
 (0)