Add aria-controls to extra-buttons trigger
This commit is contained in:
parent
0026b35f66
commit
82063f34b2
@ -1,4 +1,5 @@
|
|||||||
import Completion from '../../services/completion/completion.js'
|
import Completion from '../../services/completion/completion.js'
|
||||||
|
import genRandomSeed from '../../services/random_seed/random_seed.service.js'
|
||||||
import EmojiPicker from '../emoji_picker/emoji_picker.vue'
|
import EmojiPicker from '../emoji_picker/emoji_picker.vue'
|
||||||
import Popover from 'src/components/popover/popover.vue'
|
import Popover from 'src/components/popover/popover.vue'
|
||||||
import ScreenReaderNotice from 'src/components/screen_reader_notice/screen_reader_notice.vue'
|
import ScreenReaderNotice from 'src/components/screen_reader_notice/screen_reader_notice.vue'
|
||||||
@ -110,7 +111,7 @@ const EmojiInput = {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
randomSeed: `${Math.random()}`.replace('.', '-'),
|
randomSeed: genRandomSeed(),
|
||||||
input: undefined,
|
input: undefined,
|
||||||
caretEl: undefined,
|
caretEl: undefined,
|
||||||
highlighted: -1,
|
highlighted: -1,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Popover from '../popover/popover.vue'
|
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 ConfirmModal from '../confirm_modal/confirm_modal.vue'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
@ -40,7 +41,8 @@ const ExtraButtons = {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
showingDeleteDialog: false
|
showingDeleteDialog: false,
|
||||||
|
randomSeed: genRandomSeed()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -152,6 +154,15 @@ const ExtraButtons = {
|
|||||||
editingAvailable () { return this.$store.state.instance.editingAvailable },
|
editingAvailable () { return this.$store.state.instance.editingAvailable },
|
||||||
shouldConfirmDelete () {
|
shouldConfirmDelete () {
|
||||||
return this.$store.getters.mergedConfig.modalOnDelete
|
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'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<Popover
|
<Popover
|
||||||
class="ExtraButtons"
|
class="ExtraButtons"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:triggerAttrs="{ title: $t('status.more_actions') }"
|
:trigger-attrs="triggerAttrs"
|
||||||
placement="top"
|
placement="top"
|
||||||
:offset="{ y: 5 }"
|
:offset="{ y: 5 }"
|
||||||
:bound-to="{ x: 'container' }"
|
:bound-to="{ x: 'container' }"
|
||||||
@ -14,6 +14,7 @@
|
|||||||
<div
|
<div
|
||||||
class="dropdown-menu"
|
class="dropdown-menu"
|
||||||
role="menu"
|
role="menu"
|
||||||
|
:id="`popup-menu-${randomSeed}`"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
v-if="canMute && !status.thread_muted"
|
v-if="canMute && !status.thread_muted"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Timeago from 'components/timeago/timeago.vue'
|
import Timeago from 'components/timeago/timeago.vue'
|
||||||
|
import genRandomSeed from '../../services/random_seed/random_seed.service.js'
|
||||||
import RichContent from 'components/rich_content/rich_content.jsx'
|
import RichContent from 'components/rich_content/rich_content.jsx'
|
||||||
import { forEach, map } from 'lodash'
|
import { forEach, map } from 'lodash'
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
choices: [],
|
choices: [],
|
||||||
randomSeed: `${Math.random()}`.replace('.', '-')
|
randomSeed: genRandomSeed()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import statusPoster from '../../services/status_poster/status_poster.service.js'
|
import statusPoster from '../../services/status_poster/status_poster.service.js'
|
||||||
|
import genRandomSeed from '../../services/random_seed/random_seed.service.js'
|
||||||
import MediaUpload from '../media_upload/media_upload.vue'
|
import MediaUpload from '../media_upload/media_upload.vue'
|
||||||
import ScopeSelector from '../scope_selector/scope_selector.vue'
|
import ScopeSelector from '../scope_selector/scope_selector.vue'
|
||||||
import EmojiInput from '../emoji_input/emoji_input.vue'
|
import EmojiInput from '../emoji_input/emoji_input.vue'
|
||||||
@ -162,7 +163,7 @@ const PostStatusForm = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
randomSeed: `${Math.random()}`.replace('.', '-'),
|
randomSeed: genRandomSeed(),
|
||||||
dropFiles: [],
|
dropFiles: [],
|
||||||
uploadingFiles: false,
|
uploadingFiles: false,
|
||||||
error: null,
|
error: null,
|
||||||
|
3
src/services/random_seed/random_seed.service.js
Normal file
3
src/services/random_seed/random_seed.service.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
const genRandomSeed = () => `${Math.random()}`.replace('.', '-')
|
||||||
|
|
||||||
|
export default genRandomSeed
|
Loading…
Reference in New Issue
Block a user