mirror of https://github.com/fantasticit/think.git
titap: fix unset color
This commit is contained in:
parent
bb1924e89b
commit
0b77a58d86
|
@ -18,7 +18,7 @@ export const BackgroundColor: React.FC<{ editor: Editor }> = ({ editor }) => {
|
|||
const backgroundColor = useAttributes(
|
||||
editor,
|
||||
'textStyle',
|
||||
{ backgroundColor: 'transparent' },
|
||||
{ backgroundColor: null },
|
||||
(attrs) => attrs.backgroundColor
|
||||
);
|
||||
const isTitleActive = useActive(editor, Title.name);
|
||||
|
|
|
@ -20,12 +20,7 @@ const FlexStyle = {
|
|||
export const TextColor: React.FC<{ editor: Editor }> = ({ editor }) => {
|
||||
const isTitleActive = useActive(editor, Title.name);
|
||||
const isTextStyleActive = useActive(editor, TextStyle.name);
|
||||
const color = useAttributes<Color, Color['color']>(
|
||||
editor,
|
||||
'textStyle',
|
||||
{ color: 'transparent' },
|
||||
(attrs) => attrs.color
|
||||
);
|
||||
const color = useAttributes<Color, Color['color']>(editor, 'textStyle', { color: null }, (attrs) => attrs.color);
|
||||
|
||||
const setColor = useCallback(
|
||||
(color) => {
|
||||
|
|
Loading…
Reference in New Issue