diff --git a/addon/components/hyper-table-v2/manage-columns.ts b/addon/components/hyper-table-v2/manage-columns.ts index 43d2f540..77cd57d0 100644 --- a/addon/components/hyper-table-v2/manage-columns.ts +++ b/addon/components/hyper-table-v2/manage-columns.ts @@ -108,6 +108,14 @@ export default class HyperTableV2ManageColumns extends Component { this.dropdownVisibility = 'visible'; + + later( + this, + () => { + document.querySelector('.available-fields-wrapper input')?.focus(); + }, + 150 + ); }); } } @@ -119,6 +127,7 @@ export default class HyperTableV2ManageColumns extends Component { this.displayAvailableFields = false; + this.searchColumnDefinitionKeyword = ''; }, 300 ); diff --git a/addon/components/hyper-table/index.js b/addon/components/hyper-table/index.js index 22bf2acd..38646bd3 100644 --- a/addon/components/hyper-table/index.js +++ b/addon/components/hyper-table/index.js @@ -2,7 +2,7 @@ import { A } from '@ember/array'; import Component from '@ember/component'; import { computed, observer, set } from '@ember/object'; import { alias, and, filterBy } from '@ember/object/computed'; -import { debounce, once, scheduleOnce } from '@ember/runloop'; +import { debounce, later, once, scheduleOnce } from '@ember/runloop'; import { compare, isEmpty, typeOf } from '@ember/utils'; export default Component.extend({ @@ -242,10 +242,21 @@ export default Component.extend({ } this.manager.toggleProperty('availableFieldsPanel'); this.manager.set('availableTableViews', false); + + later( + this, + () => { + const searchInput = document.querySelector('.available-fields-wrapper input'); + if (searchInput !== null) searchInput.focus(); + }, + 150 + ); }, closeAvailableFields() { this.manager.set('availableFieldsPanel', false); + this.set('_availableFieldsKeyword', ''); + this.notifyPropertyChange('_orderedFilteredClusters'); }, openAvailableViews() { diff --git a/translations/en-us.yaml b/translations/en-us.yaml index c0fefcb3..4f40f244 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -10,7 +10,7 @@ hypertable: manage_fields: title: Manage Fields all_fields: All Fields - search_placeholder: Search Fields + search_placeholder: Search... no_columns: No columns found column: remove: Remove Field @@ -87,4 +87,4 @@ hypertable: records_selected: '{count, plural, =0 {{count} record is selected} =1 {{count} record is selected} other {{count} records are selected}}' all_records_selected: All records ({count}) are selected select_all: '{count, plural, =1 {Select all {count} record} other {Select all {count} records}}' - clear: Clear selection \ No newline at end of file + clear: Clear selection