Skip to content

Commit

Permalink
Fixed Component URLInput not honouring className (#13800)
Browse files Browse the repository at this point in the history
* Fixed Component URLInput not honouring className

Related: #13754
This pull request fixes the URIInput Component not honouring. This add the className to the parent div for the component

* Updated URLInput Readme for className prop
  • Loading branch information
ashwin-pc authored and youknowriad committed Mar 6, 2019
1 parent ed062c2 commit 53f0250
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/editor/src/components/url-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ Renders the URL input field used by the `URLInputButton` component. It can be us

If you are not conditionally rendering this component set this property to `false`.

### `className: String`

*Optional.* Adds and optional class to the parent `div` that wraps the URLInput field and popover

## Example

{% codetabs %}
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/url-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ class URLInput extends Component {
}

render() {
const { value = '', autoFocus = true, instanceId } = this.props;
const { value = '', autoFocus = true, instanceId, className } = this.props;
const { showSuggestions, posts, selectedSuggestion, loading } = this.state;
/* eslint-disable jsx-a11y/no-autofocus */
return (
<div className="editor-url-input">
<div className={ classnames( 'editor-url-input', className ) }>
<input
autoFocus={ autoFocus }
type="text"
Expand Down

0 comments on commit 53f0250

Please sign in to comment.