From 84e2fa1a5e42badbbcd88b4eccc1d11abae231fb Mon Sep 17 00:00:00 2001 From: HJ <30-hj@users.noreply.git.pleroma.social> Date: Sun, 12 Nov 2023 23:06:14 +0000 Subject: Merge branch 'tusooa/react-more-actions-fix' into 'develop' Accessibility for react & extra buttons See merge request pleroma/pleroma-fe!1869 (cherry picked from commit 18c0cf1845a95db2d0e894d2455cdd4dc545aaf7) 0026b35f Add alt text for react and extra-buttons popup 82063f34 Add aria-controls to extra-buttons trigger 5ff14837 Add changelog --- src/components/extra_buttons/extra_buttons.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/components/extra_buttons/extra_buttons.js') diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 48b960b2..e2c88ceb 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -1,4 +1,5 @@ import Popover from '../popover/popover.vue' +import genRandomSeed from '../../services/random_seed/random_seed.service.js' import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -40,7 +41,8 @@ const ExtraButtons = { data () { return { expanded: false, - showingDeleteDialog: false + showingDeleteDialog: false, + randomSeed: genRandomSeed() } }, methods: { @@ -152,6 +154,15 @@ const ExtraButtons = { editingAvailable () { return this.$store.state.instance.editingAvailable }, shouldConfirmDelete () { return this.$store.getters.mergedConfig.modalOnDelete + }, + triggerAttrs () { + return { + title: this.$t('status.more_actions'), + id: `popup-trigger-${this.randomSeed}`, + 'aria-controls': `popup-menu-${this.randomSeed}`, + 'aria-expanded': this.expanded, + 'aria-haspopup': 'menu' + } } } } -- cgit v1.2.3-70-g09d2