mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
FIX: Admin setting search debounce losing characters (#27238)
When typing slowly in the admin setting filter input,
we were losing characters after the debounce. This commit
changes to use native <input /> instead of the ember
<Input /> component similar to the change in
bfd6a7b86c
c.f. https://meta.discourse.org/t/settings-filter-loses-some-of-the-letters-you-entered/305201
This commit is contained in:
parent
963b9fd157
commit
684492f2c5
|
@ -23,18 +23,6 @@ export default class AdminPluginFilteredSiteSettings extends Component {
|
|||
this.filterChanged({ filter: "", onlyOverridden: false });
|
||||
}
|
||||
|
||||
filterSettings(filterData) {
|
||||
this.args.onFilterChanged(filterData);
|
||||
this.visibleSettings = this.siteSettingFilter.filterSettings(
|
||||
filterData.filter,
|
||||
{
|
||||
includeAllCategory: false,
|
||||
onlyOverridden: filterData.onlyOverridden,
|
||||
}
|
||||
)[0]?.siteSettings;
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
@action
|
||||
filterChanged(filterData) {
|
||||
this._debouncedOnChangeFilter(filterData);
|
||||
|
@ -54,6 +42,18 @@ export default class AdminPluginFilteredSiteSettings extends Component {
|
|||
);
|
||||
}
|
||||
|
||||
filterSettings(filterData) {
|
||||
this.args.onFilterChanged(filterData);
|
||||
this.visibleSettings = this.siteSettingFilter.filterSettings(
|
||||
filterData.filter,
|
||||
{
|
||||
includeAllCategory: false,
|
||||
onlyOverridden: filterData.onlyOverridden,
|
||||
}
|
||||
)[0]?.siteSettings;
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
<template>
|
||||
<AdminSiteSettingsFilterControls
|
||||
@onChangeFilter={{this.filterChanged}}
|
||||
|
|
|
@ -6,7 +6,6 @@ import { action } from "@ember/object";
|
|||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import TextField from "discourse/components/text-field";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
|
||||
export default class AdminSiteSettingsFilterControls extends Component {
|
||||
|
@ -28,6 +27,12 @@ export default class AdminSiteSettingsFilterControls extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
@action
|
||||
onChangeFilterInput(event) {
|
||||
this.filter = event.target.value;
|
||||
this.onChangeFilter();
|
||||
}
|
||||
|
||||
@action
|
||||
onToggleOverridden(event) {
|
||||
this.onlyOverridden = event.target.checked;
|
||||
|
@ -57,14 +62,14 @@ export default class AdminSiteSettingsFilterControls extends Component {
|
|||
class="menu-toggle"
|
||||
/>
|
||||
{{/if}}
|
||||
<TextField
|
||||
@type="text"
|
||||
@value={{this.filter}}
|
||||
placeholder={{i18n "type_to_filter"}}
|
||||
@onChange={{this.onChangeFilter}}
|
||||
class="no-blur"
|
||||
<input
|
||||
{{on "input" this.onChangeFilterInput}}
|
||||
id="setting-filter"
|
||||
class="no-blur admin-site-settings-filter-controls__input"
|
||||
placeholder={{i18n "type_to_filter"}}
|
||||
autocomplete="off"
|
||||
type="text"
|
||||
value={{this.filter}}
|
||||
/>
|
||||
<DButton
|
||||
@action={{this.clearFilter}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Controller from "@ember/controller";
|
||||
import { action } from "@ember/object";
|
||||
|
||||
export default class AdminSiteSettingsController extends Controller {
|
||||
export default class AdminPluginsShowSettingsController extends Controller {
|
||||
filter = "";
|
||||
|
||||
@action
|
||||
|
|
Loading…
Reference in New Issue
Block a user