Commit 5f54badd authored by Sean Bao's avatar Sean Bao Committed by 陈帅

Fix header search debounce enter

parent 0dc58220
...@@ -65,18 +65,18 @@ export default class HeaderSearch extends PureComponent { ...@@ -65,18 +65,18 @@ export default class HeaderSearch extends PureComponent {
}); });
}; };
debouncePressEnter() {
const { onPressEnter } = this.props;
const { value } = this.state;
onPressEnter(value);
}
// NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次 // NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次
@Bind() @Bind()
@Debounce(500, { @Debounce(500, {
leading: true, leading: true,
trailing: false, trailing: false,
}) })
debouncePressEnter() {
const { onPressEnter } = this.props;
const { value } = this.state;
onPressEnter(value);
}
render() { render() {
const { className, placeholder, ...restProps } = this.props; const { className, placeholder, ...restProps } = this.props;
const { searchMode, value } = this.state; const { searchMode, value } = this.state;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment