Skip to content

Commit

Permalink
Adding withInstanceId - Fails to work
Browse files Browse the repository at this point in the history
Cannot read property 'instanceId' of undefined
  • Loading branch information
mehigh committed Jul 1, 2017
1 parent e4ada8e commit 7aef002
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blocks/editable/format-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from 'i18n';
import { Component } from 'element';
import { IconButton, Toolbar } from 'components';
import { IconButton, Toolbar, withInstanceId } from 'components';
import { ESCAPE } from 'utils/keycodes';

const FORMATTING_CONTROLS = [
Expand Down Expand Up @@ -118,7 +118,7 @@ class FormatToolbar extends Component {
} );
}

render() {
render( { instanceId } ) {
const { formats, focusPosition, enabledControls = DEFAULT_CONTROLS } = this.props;
const linkStyle = focusPosition
? { position: 'absolute', ...focusPosition }
Expand Down Expand Up @@ -151,11 +151,11 @@ class FormatToolbar extends Component {
className="editable-format-toolbar__link-modal"
style={ linkStyle }
onSubmit={ this.submitLink }>
<label className="screen-reader-text" htmlFor="editable-format-toolbar__link-input">{ __( 'URL' ) }</label>
<label className="screen-reader-text" htmlFor={ `editable-format-toolbar__link-input-${ instanceId }` }>{ __( 'URL' ) }</label>
<input
autoFocus
className="editable-format-toolbar__link-input"
id="editable-format-toolbar__link-input"
id={ `editable-format-toolbar__link-input-${ instanceId }` }
type="url"
required
value={ this.state.linkValue }
Expand Down

0 comments on commit 7aef002

Please sign in to comment.