mirror of
https://github.com/mastodon/mastodon.git
synced 2024-06-01 19:43:29 +00:00
Merge c724d7b09c
into 2da2a1dae9
This commit is contained in:
commit
dc0e91017a
|
@ -164,6 +164,25 @@ class Search extends PureComponent {
|
|||
this.setState({ expanded: false, selectedOption: -1 });
|
||||
};
|
||||
|
||||
handleDragOver = (e) => {
|
||||
e.preventDefault();
|
||||
};
|
||||
handleDrop = (e) => {
|
||||
const { onChange } = this.props;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
this.setState({ expanded: true, selectedOption: -1 });
|
||||
|
||||
// TODO: update the type parameter if/when `url-desc` is standardized
|
||||
let query = e.dataTransfer.getData('text/x-moz-url-desc') ||
|
||||
e.dataTransfer.getData('text/uri-list') ||
|
||||
e.dataTransfer.getData('text/plain');
|
||||
onChange(query);
|
||||
this._calculateOptions(query);
|
||||
e.target.focus();
|
||||
};
|
||||
|
||||
handleHashtagClick = () => {
|
||||
const { value, onClickSearchResult, history } = this.props;
|
||||
|
||||
|
@ -335,6 +354,8 @@ class Search extends PureComponent {
|
|||
onKeyDown={this.handleKeyDown}
|
||||
onFocus={this.handleFocus}
|
||||
onBlur={this.handleBlur}
|
||||
onDragOver={this.handleDragOver}
|
||||
onDrop={this.handleDrop}
|
||||
/>
|
||||
|
||||
<div role='button' tabIndex={0} className='search__icon' onClick={this.handleClear}>
|
||||
|
|
Loading…
Reference in a new issue