mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:33:24 +08:00
FIX: Prevent browser refresh when clicking search menu result (#23881)
This commit is contained in:
parent
7f580a3083
commit
d4399b4f3d
|
@ -1,4 +1,6 @@
|
|||
import Component from "@glimmer/component";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { wantsNewWindow } from "discourse/lib/intercept-click";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
|
@ -20,7 +22,13 @@ export default class Types extends Component {
|
|||
}
|
||||
|
||||
@action
|
||||
onClick() {
|
||||
onClick(event) {
|
||||
if (wantsNewWindow(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
DiscourseURL.routeTo(event.currentTarget.href);
|
||||
this.args.closeSearchMenu();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user