refactor(core): use a11y activation util from @nextcloud/vue

* resolves https://github.com/nextcloud-libraries/nextcloud-vue/issues/2844

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-09-23 15:24:29 +02:00
parent e6d9974b2d
commit 6543ee22a6
3 changed files with 4 additions and 26 deletions

View file

@ -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
}

View file

@ -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 = ''
+ '<div class="menu popovermenu menu-left hidden contactsmenu-popover">'

View file

@ -3,9 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import $ from 'jquery'
import { isA11yActivation } from '@nextcloud/vue/functions/a11y'
import { createFocusTrap } from 'focus-trap'
import { isA11yActivation } from '../Util/a11y.js'
import $ from 'jquery'
$.widget('oc.ocdialog', {
options: {