From bff8dc43262fab4991dd13d9762410a67daecc03 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Wed, 4 Jan 2023 22:54:20 -0500 Subject: [PATCH] Improve accessibility of Channel View (#2984) * Improve channel info bar * Reduce width of channel search bar * fix sizing * improve channel view accessibility Co-Authored-By: Jason <84899178+jasonhenriquez@users.noreply.github.com> * Update src/renderer/components/ft-channel-bubble/ft-channel-bubble.js Co-authored-by: PikachuEXE * Stop space from clicking channel-bubble (links) Co-authored-by: vallode <18506096+vallode@users.noreply.github.com> Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com> Co-authored-by: PikachuEXE --- .../ft-channel-bubble/ft-channel-bubble.js | 15 ++- .../ft-channel-bubble/ft-channel-bubble.vue | 8 +- src/renderer/views/Channel/Channel.css | 54 ++++++--- src/renderer/views/Channel/Channel.js | 33 +++++- src/renderer/views/Channel/Channel.vue | 110 ++++++++++++------ 5 files changed, 165 insertions(+), 55 deletions(-) diff --git a/src/renderer/components/ft-channel-bubble/ft-channel-bubble.js b/src/renderer/components/ft-channel-bubble/ft-channel-bubble.js index d9752676b..ca2a775cb 100644 --- a/src/renderer/components/ft-channel-bubble/ft-channel-bubble.js +++ b/src/renderer/components/ft-channel-bubble/ft-channel-bubble.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import { sanitizeForHtmlId } from '../../helpers/accessibility' export default Vue.extend({ name: 'FtChannelBubble', @@ -21,8 +22,20 @@ export default Vue.extend({ selected: false } }, + computed: { + sanitizedId: function() { + return 'channelBubble' + sanitizeForHtmlId(this.channelName) + } + }, methods: { - handleClick: function () { + handleClick: function (event) { + if (event instanceof KeyboardEvent) { + if (event.target.getAttribute('role') === 'link' && event.key !== 'Enter') { + return + } + event.preventDefault() + } + if (this.showSelected) { this.selected = !this.selected } diff --git a/src/renderer/components/ft-channel-bubble/ft-channel-bubble.vue b/src/renderer/components/ft-channel-bubble/ft-channel-bubble.vue index 7e9cd68d8..0f6563d4a 100644 --- a/src/renderer/components/ft-channel-bubble/ft-channel-bubble.vue +++ b/src/renderer/components/ft-channel-bubble/ft-channel-bubble.vue @@ -1,7 +1,10 @@