File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ const propTypes = {
2727 onTab : PropTypes . func ,
2828 onUpArrow : PropTypes . func ,
2929 onDownArrow : PropTypes . func ,
30- readOnly : PropTypes . bool
30+ readOnly : PropTypes . bool ,
31+ showButtons : PropTypes . bool
3132} ;
3233
3334const EditorWrapper = React . createClass ( {
@@ -54,7 +55,8 @@ const EditorWrapper = React.createClass({
5455 blockRendererFn : ( ) => { } ,
5556 blockStyleFn : ( ) => { } ,
5657 keyBindingFn : ( ) => { } ,
57- readOnly : false
58+ readOnly : false ,
59+ showButtons : true
5860 } ;
5961 } ,
6062
@@ -166,16 +168,22 @@ const EditorWrapper = React.createClass({
166168 const {
167169 onChange,
168170 addKeyCommandListener,
169- removeKeyCommandListener
171+ removeKeyCommandListener,
172+ showButtons
170173 } = this . props ;
171174
175+ if ( showButtons === false ) {
176+ return null ;
177+ }
178+
172179 const decoratedState = this . getDecoratedState ( ) ;
173180
174181 return this . props . buttons . map ( ( Button , index ) => {
175182 return (
176183 < Button
177184 { ...this . getOtherProps ( ) }
178185 key = { `button-${ index } ` }
186+ attachedToEditor = { true }
179187 editorState = { decoratedState }
180188 onChange = { onChange }
181189 addKeyCommandListener = { addKeyCommandListener }
You can’t perform that action at this time.
0 commit comments