|
|
|
@ -189,7 +189,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
|
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus } = this.props;
|
|
|
|
|
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props;
|
|
|
|
|
const { suggestionsHidden } = this.state;
|
|
|
|
|
const style = { direction: 'ltr' };
|
|
|
|
|
|
|
|
|
@ -197,34 +197,38 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|
|
|
|
style.direction = 'rtl';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='autosuggest-textarea'>
|
|
|
|
|
<label>
|
|
|
|
|
<span style={{ display: 'none' }}>{placeholder}</span>
|
|
|
|
|
|
|
|
|
|
<Textarea
|
|
|
|
|
inputRef={this.setTextarea}
|
|
|
|
|
className='autosuggest-textarea__textarea'
|
|
|
|
|
disabled={disabled}
|
|
|
|
|
placeholder={placeholder}
|
|
|
|
|
autoFocus={autoFocus}
|
|
|
|
|
value={value}
|
|
|
|
|
onChange={this.onChange}
|
|
|
|
|
onKeyDown={this.onKeyDown}
|
|
|
|
|
onKeyUp={onKeyUp}
|
|
|
|
|
onFocus={this.onFocus}
|
|
|
|
|
onBlur={this.onBlur}
|
|
|
|
|
onPaste={this.onPaste}
|
|
|
|
|
style={style}
|
|
|
|
|
aria-autocomplete='list'
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
<div className='compose-form__autosuggest-wrapper'>
|
|
|
|
|
<div className='autosuggest-textarea'>
|
|
|
|
|
<label>
|
|
|
|
|
<span style={{ display: 'none' }}>{placeholder}</span>
|
|
|
|
|
|
|
|
|
|
<Textarea
|
|
|
|
|
inputRef={this.setTextarea}
|
|
|
|
|
className='autosuggest-textarea__textarea'
|
|
|
|
|
disabled={disabled}
|
|
|
|
|
placeholder={placeholder}
|
|
|
|
|
autoFocus={autoFocus}
|
|
|
|
|
value={value}
|
|
|
|
|
onChange={this.onChange}
|
|
|
|
|
onKeyDown={this.onKeyDown}
|
|
|
|
|
onKeyUp={onKeyUp}
|
|
|
|
|
onFocus={this.onFocus}
|
|
|
|
|
onBlur={this.onBlur}
|
|
|
|
|
onPaste={this.onPaste}
|
|
|
|
|
style={style}
|
|
|
|
|
aria-autocomplete='list'
|
|
|
|
|
/>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
{children}
|
|
|
|
|
</div>,
|
|
|
|
|
<div className='autosuggest-textarea__suggestions-wrapper'>
|
|
|
|
|
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
|
|
|
|
|
{suggestions.map(this.renderSuggestion)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
</div>,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|