2525 class="commentItemBackground"
2626 :class =" {
2727 highlightCommentItem: isHighlightedComment (commentItem ),
28- ' focused-comment' : focusedCommentId === commentItem .opinionSlugId ,
2928 } "
3029 @keydown =" handleKeyNavigation ($event , index )"
31- @focus =" onCommentFocus (commentItem )"
32- @blur =" onCommentBlur (commentItem )"
3330 >
3431 <!-- Hidden metadata for screen readers -->
3532 <div :id =" `comment-meta-${commentItem.opinionSlugId}`" class =" sr-only" >
6158</template >
6259
6360<script setup lang="ts">
64- import { computed , ref , nextTick } from " vue" ;
61+ import { computed , nextTick } from " vue" ;
6562import type { OpinionItem , VotingAction } from " src/shared/types/zod" ;
6663import type { OpinionVotingUtilities } from " src/composables/opinion/types" ;
6764import CommentItem from " ./item/CommentItem.vue" ;
@@ -78,9 +75,6 @@ const props = defineProps<{
7875 loginRequiredToParticipate: boolean ;
7976}>();
8077
81- // Reactive state for focus management
82- const focusedCommentId = ref <string | null >(null );
83-
8478const finalCommentList = computed ((): OpinionItem [] => {
8579 const result: OpinionItem [] = [];
8680
@@ -183,22 +177,6 @@ async function focusCommentById(commentId: string): Promise<void> {
183177 }
184178}
185179
186- /**
187- * Handles comment focus events
188- */
189- function onCommentFocus(commentItem : OpinionItem ): void {
190- focusedCommentId .value = commentItem .opinionSlugId ;
191- }
192-
193- /**
194- * Handles comment blur events
195- */
196- function onCommentBlur(commentItem : OpinionItem ): void {
197- if (focusedCommentId .value === commentItem .opinionSlugId ) {
198- focusedCommentId .value = null ;
199- }
200- }
201-
202180/**
203181 * Emits vote change event
204182 */
@@ -230,23 +208,6 @@ function mutedComment(): void {
230208
231209.commentItemBackground {
232210 background-color : white ;
233- transition :
234- box-shadow 0.2s ease ,
235- outline 0.2s ease ;
236-
237- // Focus styles for keyboard navigation
238- & :focus {
239- outline : 2px solid $primary ;
240- outline-offset : 2px ;
241- box-shadow : 0 0 0 4px rgba ($primary , 0.1 );
242- }
243-
244- // Enhanced focus indicator for better visibility
245- & :focus-visible {
246- outline : 3px solid $primary ;
247- outline-offset : 3px ;
248- box-shadow : 0 0 0 6px rgba ($primary , 0.15 );
249- }
250211}
251212
252213.highlightCommentItem {
@@ -255,10 +216,6 @@ function mutedComment(): void {
255216 border-width : 2px ;
256217}
257218
258- .focused-comment {
259- background-color : rgba ($primary , 0.04 );
260- }
261-
262219// Screen reader only content - visually hidden but accessible to screen readers
263220.sr-only {
264221 position : absolute !important ;
@@ -278,17 +235,5 @@ function mutedComment(): void {
278235 border-width : 3px ;
279236 border-color : currentColor ;
280237 }
281-
282- .commentItemBackground :focus {
283- outline-width : 3px ;
284- outline-color : currentColor ;
285- }
286- }
287-
288- // Reduced motion preferences
289- @media (prefers-reduced-motion : reduce) {
290- .commentItemBackground {
291- transition : none ;
292- }
293238}
294239 </style >
0 commit comments