From 20603e3f68121ab5eed319f17e2cd1b871b58adf Mon Sep 17 00:00:00 2001 From: Erik Lopez Date: Wed, 17 Jun 2020 16:50:14 +0900 Subject: [PATCH] Fix UI bugs (#143) * Fix cursor position when setting read only with a default value * Pass anchorLink className to Link component * Add className to anchor tag * Move default style to anchorLink class * Update theme example * Update package version --- examples/theme/index.tsx | 3 +++ package.json | 2 +- src/MUIRichTextEditor.tsx | 11 ++++++++--- src/components/Link.tsx | 8 ++------ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/theme/index.tsx b/examples/theme/index.tsx index 0240a59..577948b 100644 --- a/examples/theme/index.tsx +++ b/examples/theme/index.tsx @@ -37,6 +37,9 @@ Object.assign(defaultTheme, { width: "inherit", position: "absolute", top: "20px" + }, + anchorLink: { + color: "#333333" } } } diff --git a/package.json b/package.json index de925ed..d20c9da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mui-rte", - "version": "1.20.0", + "version": "1.21.0", "description": "Material-UI Rich Text Editor and Viewer", "keywords": [ "material-ui", diff --git a/src/MUIRichTextEditor.tsx b/src/MUIRichTextEditor.tsx index ab3a5e4..a0e7921 100644 --- a/src/MUIRichTextEditor.tsx +++ b/src/MUIRichTextEditor.tsx @@ -160,7 +160,7 @@ const styles = ({ spacing, typography, palette }: Theme) => createStyles({ }, anchorLink: { textDecoration: "underline", - color: palette.secondary.main + color: "inherit" }, toolbar: { }, @@ -309,7 +309,11 @@ const MUIRichTextEditor: RefForwardingComponent { toggleMouseUpListener() @@ -754,7 +758,8 @@ const MUIRichTextEditor: RefForwardingComponent = (props) => { - const { url } = props.contentState.getEntity(props.entityKey).getData() + const { url, className } = props.contentState.getEntity(props.entityKey).getData() return ( {props.children}