Skip to content

Commit

Permalink
Focus global search input on open
Browse files Browse the repository at this point in the history
For better accesibility, the search input in the global search
modal should be focused when the search modal is opened.

Resolves: #41651

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe committed Nov 23, 2023
1 parent b430abb commit 32230cc
Show file tree
Hide file tree
Showing 125 changed files with 216 additions and 205 deletions.
2 changes: 1 addition & 1 deletion core/css/server.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/css/server.css.map

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion core/src/views/GlobalSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<!-- Global search form -->
<div ref="globalSearch" class="global-search-modal">
<h1>{{ t('core', 'Global search') }}</h1>
<NcInputField :value.sync="searchQuery"
<NcInputField ref="searchInput"
:value.sync="searchQuery"
type="text"
:label="t('core', 'Search apps, files, tags, messages') + '...'"
@update:value="debouncedFind" />
Expand Down Expand Up @@ -222,6 +223,15 @@ export default {
},
},
},
watch: {
isVisible(value) {
this.$nextTick(() => {
if (value) {
this.focusInput()
}
})
},
},
mounted() {
getProviders().then((providers) => {
this.providers = providers
Expand Down Expand Up @@ -503,6 +513,9 @@ export default {
this.dateFilter.text = t('core', `Between ${this.dateFilter.startFrom.toLocaleDateString()} and ${this.dateFilter.endAt.toLocaleDateString()}`)
this.updateDateFilter()
},
focusInput() {
this.$refs.searchInput.$el.children[0].children[0].focus()
},
closeModal() {
this.$refs.globalSearchModal.close()
this.searchQuery = ''
Expand Down
3 changes: 0 additions & 3 deletions dist/2048-2048.js

This file was deleted.

3 changes: 3 additions & 0 deletions dist/2250-2250.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion dist/2048-2048.js.map → dist/2250-2250.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/2857-2857.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/2857-2857.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/4107-4107.js

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion dist/6297-6297.js.map → dist/4107-4107.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/4180-4180.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/4180-4180.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/6297-6297.js

This file was deleted.

4 changes: 2 additions & 2 deletions dist/7255-7255.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/7255-7255.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/7856-7856.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/7856-7856.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-tab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

56 changes: 29 additions & 27 deletions dist/core-common.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

/**
* @copyright 2021 Christoph Wurst <[email protected]>
*
Expand Down Expand Up @@ -265,7 +267,7 @@
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
Expand All @@ -288,7 +290,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
Expand All @@ -300,7 +302,6 @@
* @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
*
* @author John Molakvoæ <[email protected]>
* @author Grigorii K. Shartsev <[email protected]>
*
* @license AGPL-3.0-or-later
*
Expand All @@ -310,8 +311,8 @@
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
Expand Down Expand Up @@ -386,6 +387,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* @copyright Copyright (c) 2019 Kristof Hamann, Paul Schwörer
*
* @author Kristof Hamann
* @author Paul Schwörer
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2020 Georg Ehrke <[email protected]>
*
Expand Down Expand Up @@ -563,28 +587,6 @@
*
*/

/**
* @copyright Copyright (c) 2023 Grigorii K. Shartsev <[email protected]>
*
* @author Grigorii K. Shartsev <[email protected]>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
Expand Down
2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-global-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-global-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-profile.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-profile.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-recommendedapps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-recommendedapps.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unsupported-browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unsupported-browser.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/dashboard-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dashboard-main.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 32230cc

Please sign in to comment.