Skip to content

Commit

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

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

* fix code style
  • Loading branch information
HoHieuLuc authored and Arel Cordero committed Sep 13, 2023
1 parent ee5e475 commit 5575b40
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 5575b40

Please sign in to comment.