From 6543ee22a60f45d86bd810bf49b73649a29d2932 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 23 Sep 2025 15:24:29 +0200 Subject: [PATCH] refactor(core): use a11y activation util from `@nextcloud/vue` * resolves https://github.com/nextcloud-libraries/nextcloud-vue/issues/2844 Signed-off-by: Ferdinand Thiessen --- core/src/Util/a11y.js | 21 --------------------- core/src/jquery/contactsmenu.js | 5 ++--- core/src/jquery/ocdialog.js | 4 ++-- 3 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 core/src/Util/a11y.js diff --git a/core/src/Util/a11y.js b/core/src/Util/a11y.js deleted file mode 100644 index 2eb753b3faf..00000000000 --- a/core/src/Util/a11y.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Return whether the DOM event is an accessible mouse or keyboard element activation - * - * @param {Event} event DOM event - * - * @return {boolean} - */ -export const isA11yActivation = (event) => { - if (event.type === 'click') { - return true - } - if (event.type === 'keydown' && event.key === 'Enter') { - return true - } - return false -} diff --git a/core/src/jquery/contactsmenu.js b/core/src/jquery/contactsmenu.js index fba014c364e..fda48b087be 100644 --- a/core/src/jquery/contactsmenu.js +++ b/core/src/jquery/contactsmenu.js @@ -3,10 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import $ from 'jquery' - import { generateUrl } from '@nextcloud/router' -import { isA11yActivation } from '../Util/a11y.js' +import { isA11yActivation } from '@nextcloud/vue/functions/a11y' +import $ from 'jquery' const LIST = '' + '