Skip to content

Commit

Permalink
Allow hiding the toolbar externally (#379)
Browse files Browse the repository at this point in the history
* Control toolbar visibility directly.

* Flip hidden 🤦
  • Loading branch information
CmdrDats committed Sep 6, 2020
1 parent a5758c0 commit f32e2a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/RichTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type Props = {
handleReturn?: (event: Object) => boolean;
customControls?: Array<CustomControl>;
readOnly?: boolean;
toolbarHidden?: boolean;
disabled?: boolean; // Alias of readOnly
toolbarConfig?: ToolbarConfig;
toolbarOnBottom?: boolean;
Expand Down Expand Up @@ -97,6 +98,7 @@ export default class RichTextEditor extends Component {
placeholder,
customStyleMap,
readOnly,
toolbarHidden,
disabled,
toolbarConfig,
toolbarOnBottom,
Expand All @@ -121,7 +123,8 @@ export default class RichTextEditor extends Component {
readOnly = disabled;
}
let editorToolbar;
if (!readOnly) {

if (!readOnly && !toolbarHidden) {
editorToolbar = (
<EditorToolbar
rootStyle={toolbarStyle}
Expand Down

0 comments on commit f32e2a4

Please sign in to comment.