Skip to content

Commit

Permalink
fix(ui): fix color picker (#1008)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarthificial committed Mar 21, 2024
1 parent d79af91 commit dfc2dae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ui/src/components/controls/ColorInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {useRef, useState} from 'preact/hooks';
import {useReducedMotion} from '../../hooks';
import {useClickOutside} from '../../hooks/useClickOutside';
import {shake} from '../animations';
import tabsStyles from '../tabs/Tabs.module.scss';
import {ColorPicker} from './ColorPicker';
import {ColorPreview} from './ColorPreview';
import styles from './Controls.module.scss';
Expand Down Expand Up @@ -54,8 +55,8 @@ export function ColorInput({value, onChange}: ColorInputProps) {
}}
onClick={event => {
const buttonRect = event.currentTarget.getBoundingClientRect();
const paneRect = document
.getElementById('settings-pane')
const paneRect = event.currentTarget
.closest(`.${tabsStyles.pane}`)
.getBoundingClientRect();
setPosition({
x: paneRect.right + 2 + 12, // 2px seperator, 12px padding
Expand Down

0 comments on commit dfc2dae

Please sign in to comment.