Skip to content

Commit

Permalink
Add placeholder attribute in render function
Browse files Browse the repository at this point in the history
Fixes #660
  • Loading branch information
ipeychev committed Jan 14, 2017
1 parent 73a56c1 commit 3cf1c4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/react/src/components/buttons/button-link-edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@
buttonClearLink = <button aria-label={AlloyEditor.Strings.clearInput} className="ae-button ae-icon-remove" onClick={this._clearLink} title={AlloyEditor.Strings.clear}></button>
}

var placeholderProp = {};

if (!CKEDITOR.env.ie && AlloyEditor.Strings) {
placeholderProp.placeholder = AlloyEditor.Strings.editLink;
}

return (
<div className="ae-container-edit-link">
<button aria-label={AlloyEditor.Strings.removeLink} className="ae-button" disabled={!this.state.element} onClick={this._removeLink} title={AlloyEditor.Strings.remove}>
Expand All @@ -216,7 +222,7 @@
<div className="ae-container-input xxl">
{targetButtonEdit}
<div className="ae-container-input flexible">
<input className="ae-input" onChange={this._handleLinkHrefChange} onKeyDown={this._handleKeyDown} placeholder={AlloyEditor.Strings.editLink} ref="linkInput" type="text" value={this.state.linkHref}></input>
<input className="ae-input" onChange={this._handleLinkHrefChange} onKeyDown={this._handleKeyDown} { ...placeholderProp } ref="linkInput" type="text" value={this.state.linkHref}></input>
{autocompleteDropdown}
</div>
{buttonClearLink}
Expand Down

1 comment on commit 3cf1c4c

@ipeychev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antoniopol06 /cc @jbalsas

I had to revert this commit, because AlloyEditor.Strings is not available in getDefaultProps function and the result was that there was no placeholder attribute of the element in any browser. It is available in render however, so I moved it there.

Thanks,

Please sign in to comment.