Skip to content

Commit

Permalink
[@mantine/tiptap] Fix incorrect color displayed in ColorPickerControl (
Browse files Browse the repository at this point in the history
…#4667)

* [@mantine/tiptap] ColorPickerControl: fix incorrect color displayed

* fix code style
  • Loading branch information
HoHieuLuc authored Sep 5, 2023
1 parent 0797082 commit c4d34b6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ export const ColorPickerControl = forwardRef<HTMLButtonElement, ColorPickerContr
const [state, setState] = useState<'palette' | 'colorPicker'>('palette');
const theme = useMantineTheme();
const currentColor =
editor?.getAttributes('textStyle').color || theme.colorScheme === 'dark'
? theme.colors.dark[1]
: theme.black;
editor?.getAttributes('textStyle').color ||
(theme.colorScheme === 'dark' ? theme.colors.dark[1] : theme.black);

const handleChange = (value: string, shouldClose = true) => {
(editor.chain() as any).focus().setColor(value).run();
Expand Down

0 comments on commit c4d34b6

Please sign in to comment.