Skip to content

Commit

Permalink
Add env check
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 20, 2019
1 parent a5d3151 commit 08119d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,13 @@ export class RichText extends Component {

setRef( node ) {
if ( node ) {
const computedStyle = getComputedStyle( node );
if ( process.env.NODE_ENV === 'development' ) {
const computedStyle = getComputedStyle( node );

if ( computedStyle.display === 'inline' ) {
window.console.warn( 'RichText cannot be used with an inline container. Please use a different tagName.' );
if ( computedStyle.display === 'inline' ) {
// eslint-disable-next-line no-console
console.warn( 'RichText cannot be used with an inline container. Please use a different tagName.' );
}
}

this.editableRef = node;
Expand Down

0 comments on commit 08119d3

Please sign in to comment.