We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cac7432 commit 8106921Copy full SHA for 8106921
packages/color-chrome/src/EyeDropper.tsx
@@ -10,10 +10,16 @@ export function EyeDropper(props: EyeDropperProps) {
10
const click = () => {
11
if ('EyeDropper' in window) {
12
const eyeDropper = new (window as any).EyeDropper();
13
- eyeDropper.open().then((result: any) => {
14
- console.log(result);
15
- props.onPickColor?.(result.sRGBHex);
16
- });
+ eyeDropper
+ .open()
+ .then((result: any) => {
+ props.onPickColor?.(result.sRGBHex);
17
+ })
18
+ .catch((err: Error) => {
19
+ if (err.name === 'AbortError') {
20
+ } else {
21
+ }
22
+ });
23
}
24
};
25
return (
0 commit comments